Update Optquest Variables

Update Optquest Variables

oscar_perez
Not applicable
826 Views
7 Replies
Message 1 of 8

Update Optquest Variables

oscar_perez
Not applicable

[ FlexSim 16.2.2 ]

simulacion-jamones-ceisa-2017-prueba2.fsm

Hi Jordan,

Please, can you help me with my model?

I have a code in post-import code and also on the boton in the main Dashboard, the boton is called "Cargar programa". This code is supposed to update the variables of the optquest according to the excel file, which is imported for each production plan. This code works propertly with version 7.7, but not with version 2016.

The variables must be permutation variables, but after executing the code they are being loaded as continuos variables.

The line that does not work is the next:

treenodeupdateOptQuestVars = node("/Tools/OptQuest/logic/updateOptQuestVars", model()); executefsnode(updateOptQuestVars, NULL);

I appreciate your answer.

Thanks in advance.

Accepted solutions (1)
827 Views
7 Replies
Replies (7)
Message 2 of 8

matt_long
Not applicable
Accepted solution

The updateOptQuestVars function was moved out of the model and into the Main tree. You can find it at:

MAIN:/project/exec/optquest/definitionLogic/updateOptQuestVars

Change your code to say:

treenodeupdateOptQuestVars = node("project/exec/optquest/definitionLogic/updateOptQuestVars", main()); 
executefsnode(updateOptQuestVars, NULL);
Message 3 of 8

oscar_perez
Not applicable

@Mate

Thanks Matt for your answer.

I think that something is missing, because the variables are still loaded as continuous variables and I needed them as permutation variables.

Could you help me to review my complete code from line 97 to 212 in the attached model?

The lines 151 and 152 are the ones that you helped me to correct.

You can find the code in the button called "Cargar Programa".

simulacion-jamones-ceisa-2017-v2.fsm

Thanks in advanced

0 Likes
Message 4 of 8

matt_long
Not applicable

I'm not sure. I don't have your import file so I can't check what's going on, but all of the code is the same from 7.7 to 16.2.

Message 5 of 8

oscar_perez
Not applicable

Hi Matt,

It was unable to attach the Excel file here, could you give me your email to send it to you?

I would like to to send you the model and the Excel file, so that you can help me to check the code and know why it does not work.

Thank you

0 Likes
Message 6 of 8

matt_long
Not applicable
0 Likes
Message 7 of 8

matt_long
Not applicable

On line 154 you were referencing the table in the experimenter window that held the variables. The structure of the view changed so you were no longer referencing the data. This was found by putting a debug point in your code and stepping through the code. Once it go to line 154, nodo_opt was null.

Instead of referencing things in the view, you should reference the data's location in your model. Change line 154 to:

treenode nodo_opt = node("Tools/OptQuest/variables",model());
Message 8 of 8

oscar_perez
Not applicable

Thank you, now it works!

0 Likes