Set up optimizer to try all combinations of entry nodes

Set up optimizer to try all combinations of entry nodes

acacil
Participant Participant
154 Views
2 Replies
Message 1 of 3

Set up optimizer to try all combinations of entry nodes

acacil
Participant
Participant

Hi, 

could anyone help me set up the optimizer, so that it tries all possible combinations of entry points (4 possible values: ICC/IXD/FC/PLP) for pallets arriving at different time stamps?

 

acacil_0-1747743588931.png

For example, for "time 0 pallet mono qty = 100", I'd like to try all entry options: ICC, IXD, FC and PLP

same for "time 0 pallet multi qty = 100", I'd like to try all entry options: ICC, IXD, FC and PLP

and the same for every row

 

in other words, try all possible combinations of entry points for every time stamp (rows).

I have no idea how to set up something like this in the optimizer.

 

thank you in advance!

 

0 Likes
Accepted solutions (1)
155 Views
2 Replies
Replies (2)
Message 2 of 3

nil_nicolau
Explorer
Explorer
Accepted solution

Hello,


If I understand correctly, you need to pass the column of the table as a parameter with four possible values, right? This will allow you to add the parameters to the optimizer.


To do that, the only way I see is to create a parameter for each row.


I created a code to try to automate this process, but you will need to create the first parameter manually.


The name of the parameter doesn’t matter, but for its value, we need to set the type as "Option." Then, create four options and add the corresponding name to each one (just to visualize them in the parameters). Next, set the reference to the first row, second column of the table.

 


In the onSet code, insert something like this:

Array names = ["ICC","IXD","FC","PLP"];
reference.value = names[newValue];

 

Once this parameter is set up correctly, you can copy it across the entire table by executing a script like this:

 

treenode parameters = Model.find("Tools/ParameterTables/Parameters>variables/parameters");
string TableName = "GlobalTable1";

Table table = Table(TableName);

int num = 0;
int j = 2;//Column
treenode Copied;
for (int i = 1; i <= table.numRows; i++){
	num += 1;
		
	if(parameters.subnodes.length < num){
		treenode toCopy = parameters.last;
		nodeinsertafter(toCopy);
		Copied = createcopy(toCopy,toCopy.next,0,0,0,1);
	}
	else{
		Copied = parameters.subnodes[num];
	}
		
	Copied.find("/Name").value = TableName + "[" + i + "][" + j + "]";
	Copied.find("/Value/reference").value = table.as(treenode).subnodes[i].subnodes[j];
}

 

This will create one parameter for each row, copying all the information but changing the name and the reference.


Thank you!

 

0 Likes
Message 3 of 3

acacil
Participant
Participant

Thanks Nil, exactly what I needed!

0 Likes