question

Farah A avatar image
0 Likes"
Farah A asked Jason Lightfoot commented

How to run the optimizer from the process flow automatically ?

Hello everyone,

I'm new to optQuest and i would like to run it automatically from process flow to test different scenarios when a given event happens.

I'm taking as a simple example the following case to illustrate what i want to do:

- I have a conveyor connected then to three different machines with different processing time

- On arrival to a given decision point, i would like to trigger the optimizer from process flow automatically so that i can test different possible scenarios ( considering processing time of the different machines and their availabilities) in order to minimize the total production time and return the results in the console

Is it possible to do so?

Here is the illustrative model : PT4.fsm

Thanks in advance for your help !!

FlexSim 22.2.2
optimizer run
pt4.fsm (54.2 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jason Lightfoot commented

FlexSim's optimizer isn't built for this use case. The optimizer in FlexSim sets parameters, then runs the model to the stop time, then records Performance Measures. The optimizer invokes many runs of the model, searching for parameter values that optimize system performance.

Your description sounds like the opposite: run the model for a bit, then run the optimizer in the middle, then continue running the model.

So how do you make a smart decision for each item? You need an algorithm or policy that makes a smart decision every time an item arrives for processing. There are a few ways you could get that algorithm:

  • You could write one yourself. This would mean writing code that looks at the current state of the model and tries to make a smart decision. When an item arrives, you'd run your custom code to get a decision.
  • You could use an existing solver. FlexSim can connect to Python libraries or to C++. If there is a solver in either of those platforms that can solve this particular problem, you could just use that. When an item arrives, you'd invoke the solver to get a decision.
  • You could learn about and use Reinforcement Learning. It's a big task to make an RL-ready model. But if you did, then you could train an agent to be good at making the decision. It takes a long time to train an agent. But once trained, you can use the agent in real life to make the same decision over and over again. You can even test the agent in the model; when an item arrives, you can just ask the agent what to do. Here's a link to FlexSim's RL documentation: https://docs.flexsim.com/en/23.0/ModelLogic/ReinforcementLearning/WorkingWithGym/GettingStarted/GettingStarted.html
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.