Set up optimizer to try all combinations of entry nodes

Set up optimizer to try all combinations of entry nodes

acacil
Participant Participant
159件の閲覧回数
2件の返信
メッセージ1/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 件のいいね
解決済み
160件の閲覧回数
2件の返信
返信 (2)
メッセージ2/3

nil_nicolau
Explorer
Explorer
解決済み

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 件のいいね
メッセージ3/3

acacil
Participant
Participant

Thanks Nil, exactly what I needed!

0 件のいいね