This is not something that can be done yet from the GUI.
Like you, the ability to run a simulation that includes a nested, dynamically-generated optimization problem is on my wish list for JaamSim.
If you know the structure of your optimization problem in advance, you could probably build it as part of an object using the Gurobi Java interface, and then populate it with values from the simulation.
In your case, it sounds like you have a natural boundary at the end of each day, so the optimizer object would just be an entity created every day.
If you look at the existing programming manual you can probably figure out how to trigger the optimization on entity creation or at an event.
I am not aware of any examples that show how to do this, so you will largely be on your own - but I'd love to see what you come up with.
It might be that you will require functionality that doesn't exist yet, such as the improved JaamSim API that the devs are currently working on.
This API should make it a lot easier for power-users to push the limits of what JaamSim can do.
The easiest case would be if you can run the optimization separate from the simulation model, and then just pass the results as input parameters.
I don't know if you can break your simulation into single-day pieces. If so, you could run 1 day, get the results, run the optimizer, and then hand in the solution as the input values for the next simulation for the next day.