question

Manuel Sinco avatar image
0 Likes"
Manuel Sinco asked Manuel Sinco commented

How to add an operator into a time table with code?

Hello, I want to add an operator or amount of operators into a Time Table using code.

I developed this code, but when I run it, I saw that the values are the tree is not the same as if I would use the GUI. This is the code:

treenode Operator    = Model.find("Operator1");
treenode OpTimeTable = getvarnode(Operator, "timetables");
string   OpName      = Operator.name;
treenode TimeTableNode = Model.find("Tools/TimeTables/TimeTable1");
treenode TTMembers     = getvarnode(TimeTableNode, "members");
string   TTName        = TimeTableNode.name;

TTMembers.subnodes.assert(OpName,OpTimeTable);
treenode NewMember = TTMembers.subnodes[OpName]; 
OpTimeTable.subnodes.assert(TTName,NewMember);

If you have a different & proper way to assign the time tables to the operators I would appreciate it.

Thanks.

Manuel Sinco.

FlexSim 19.1.0
operatorstime tabledeveloper use
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Manuel Sinco commented

You should use the memberadd() command:

memberadd(Model.find("Operator1"), "TimeTable1", 1)
· 1
5 |100000

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

Manuel Sinco avatar image Manuel Sinco commented ·

Thanks Matt! it was easier that I thought.

0 Likes 0 ·