GAMS parameter issue
Posted: Mon Jun 11, 2018 3:22 pm
Hello,
I have two loops in my model. The first (while) loop is more like a master loop and the other (for) loop is a slave one. The master loop contains the slave loop. The slave loop runs and calculates some values . The master loop use those values and make some decision which are passed to the slave one and this process continuous until some stopping criteria met.
I am using Parameter e.g, ltc3_time(cn) inside the slave loop which is initialized with zero value during the model. It stored some values related to the variables that i used in my model. Here, cn is the set value that shows how many times we want to run the slave loop (or the model). During the slave loop, some values is assigned to each of index of ltc3_time(cn) and stored.
During the first iteration, values inside ltc3_time(cn) are stored perfectly which are used by the master loop for some decision. But in the second iteration, values inside ltc3_time(cn) are supposed to be updated (that i can confirm from the variable values that are updated) but the values inside parameter ltc3_time(cn) are not updated. It does not matter how many times i run the master loop, the values inside ltc3_time(cn) remains the same as it was in the first iteration. Any solution or idea about the problem?
Thanks
I have two loops in my model. The first (while) loop is more like a master loop and the other (for) loop is a slave one. The master loop contains the slave loop. The slave loop runs and calculates some values . The master loop use those values and make some decision which are passed to the slave one and this process continuous until some stopping criteria met.
I am using Parameter e.g, ltc3_time(cn) inside the slave loop which is initialized with zero value during the model. It stored some values related to the variables that i used in my model. Here, cn is the set value that shows how many times we want to run the slave loop (or the model). During the slave loop, some values is assigned to each of index of ltc3_time(cn) and stored.
During the first iteration, values inside ltc3_time(cn) are stored perfectly which are used by the master loop for some decision. But in the second iteration, values inside ltc3_time(cn) are supposed to be updated (that i can confirm from the variable values that are updated) but the values inside parameter ltc3_time(cn) are not updated. It does not matter how many times i run the master loop, the values inside ltc3_time(cn) remains the same as it was in the first iteration. Any solution or idea about the problem?
Thanks