Random Ordering of Production Plan as an Experimenter Scenario

Random Ordering of Production Plan as an Experimenter Scenario

borja_lorenzo4278
Advocate Advocate
279 Views
7 Replies
Message 1 of 8

Random Ordering of Production Plan as an Experimenter Scenario

borja_lorenzo4278
Advocate
Advocate

[ FlexSim 24.1.1 ]

Hello,

I have a production plan in the Global Table "Plan_Produccion" with the orders to be placed and a Calculated Table where I get the total production time "TiempoTotalProduccion".

I need to get the best order of the orders from the production plan to get the lowest "TiempoTotalProduccion".

The idea would be to use the Experimenter to test different combinations in the ordering of the orders in the "Plan_Produccion". With different orderings of the orders, the proposed KPI of TiempoTotalProduccion (which will be defined as a Performance Measure) will vary its value. I know that this optimization would be the subject of study for OptiQuest, but before getting there, I would like to propose an intermediate option. The idea is to make this ordering automatic, and the number of combinations can be introduced as a Parameter (resulting in an error when the number of combinations is greater than the maximum possible number of combinations (number of rows raised to the number of rows)). With this, we would not obtain the optimal combination, but we could choose the best of the proposed combinations.


Could this random ordering of the production plan depend on a parameter, and could each combination be defined as a different scenario in the Experimenter?

I attach the file.

Thank you very much in advance.


Simplificación Statistic Collector from List 250114.fsm

0 Likes
Accepted solutions (1)
280 Views
7 Replies
Replies (7)
Message 2 of 8

moehlmann_fe
Advocate
Advocate
Accepted solution

The first change you would need to make is to create a duplicate of the production table that serves as a base and stays unchanged at all times. Through the On Set code of a parameter or the model reset trigger you would then generate the production table used in the model run by copying over row by row in varying sequences.

You can use the "Sequence" parameter type for this. By selecting to run a "Range-Based" job in the experimenter a scenario for each possible permuation will be created automatically.

1736861078977.png

Message 3 of 8

borja_lorenzo4278
Advocate
Advocate

Hello

Thank you for your quick response.
In the definition of the Seq. length parameter, I have defined it with a code that looks at the number of rows in the Global Table (Plan_Produccion). Do I have to define the On Set code using FlexScript, or is there an option to do it through a guided assistant?

1736863019296.png

0 Likes
Message 4 of 8

moehlmann_fe
Advocate
Advocate

Sorting the rows into the actual production table needs to be done through self-written code.

Message 5 of 8

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Borja Lorenzo, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes
Message 6 of 8

borja_lorenzo4278
Advocate
Advocate

Hello

I could tested Felix's propousal.

I have created the custom code at trigger on Set from Parameter 1 (Sequence type), that makes a copy of the "Plan_Produccion" table, copying rows whose index must be given by the element of parameter 1 (sequencer). I understand that in each execution, the Experimenter uses a different parameter, and from there arises the variation of the "Plan_Produccion_Copia" table.

In the custom code, I referred to the array of parameter 1 (sequencer) as newValue: param(2). I have changed my Process Flow to be linked to the copy table ("Plan_Produccion_Copia"), which I interpreted changes its order based on the different parameter applied by the Experimenter.

I'm not sure if I have understood the approach correctly or if I am interpreting the data correctly. I would appreciate your help with this.

Thank you very much.

Attached is the reference model.

Simplificación Statistic Collector from List 250124.fsm

0 Likes
Message 7 of 8

moehlmann_fe
Advocate
Advocate
The parameter correctly fills in the copied table. However the order in the table doesn't actually have any impact on the logic in the model. The "Op" label array gets assigned to the tokens but is never used.
Message 8 of 8

borja_lorenzo4278
Advocate
Advocate

Thank you very much.

You have been a great help.

You are right, it was a mistake. Since this is a test model, it didn't have an updated model. I have been addressing the issues in isolation. I am attaching the updated and corrected model. For me, the results obtained make sense. As this is the first time I am configuring something like this, I would like to confirm if you observe any deviation.


I am attaching the file in case it is useful to someone as a reference. In it, you can see the creation of Statistic Collector, Calculate Table, Experimenter associated with a random ordering of rows in a global table.


I would like to report an error that I get when exporting to Excel. I am attaching it.

1737740325684.png

The Excel file (also attached) has an empty Sheet 1.

Besides I understand that with the creation of filters, the values could be ordered in ascending order, right? What is the name of this results table so I can declare it in the query?

Simplificación Statistic Collector from List 250124_3.fsm
Reporte.xlsx

Again, thank you very much.

0 Likes