Difference between revisions of "Error Messages/42539"
(Created page with "= Error Message Examples = In the call to DefineOptimization, 4 values are being passed to the «guess» parameter where at most 2 are expected (since 2 values are specif...") |
|||
Line 1: | Line 1: | ||
− | + | [[Category: Error messages]] | |
− | In the call to | + | == Error message examples == |
+ | |||
+ | <pre style="background:white; border:white; margin-left: 1em; font-style:italic"> | ||
+ | In the call to DefineOptimization, 4 values are being passed to the «guess» parameter where | ||
at most 2 are expected (since 2 values are specified for the «decisions» parameter) | at most 2 are expected (since 2 values are specified for the «decisions» parameter) | ||
− | In the call to | + | In the call to DefineOptimization, 3 values are being passed to the «domain» parameter where |
one is expected (since one value is specified for the «decisions» parameter) | one is expected (since one value is specified for the «decisions» parameter) | ||
+ | </pre> | ||
− | = Cause = | + | == Cause == |
You have listed too many values in the «guess» or «domain» parameter of [[DefineOptimization]]. These parameters are in positional correspondence with the parameters passed to the «decisions» parameter, and so it doesn't make sense for there to be more values passed to the «guess» parameter than there are parameters passed to the «decisions» parameter. | You have listed too many values in the «guess» or «domain» parameter of [[DefineOptimization]]. These parameters are in positional correspondence with the parameters passed to the «decisions» parameter, and so it doesn't make sense for there to be more values passed to the «guess» parameter than there are parameters passed to the «decisions» parameter. | ||
Line 13: | Line 17: | ||
The following example results in this error: | The following example results in this error: | ||
− | + | <pre style="background:white; border:white; margin-left: 1em;"> | |
+ | DefineOptimization( | ||
decisions: Units_to_make, Labor_alloc, | decisions: Units_to_make, Labor_alloc, | ||
− | guess:1,2, | + | guess: 1, 2, 3, 4, |
constraints: Avail_labor, Meet_req_effort, | constraints: Avail_labor, Meet_req_effort, | ||
− | maximize: Net_Profit ) | + | maximize: Net_Profit) |
+ | </pre> | ||
− | In this definition, 1 is the guess for | + | In this definition, 1 is the guess for <code>Units_to_make</code>, 2 is the guess for <code>Labor_alloc</code>, but 3 and 4 are just extra and are the cause of this error. |
The following would also cause this error, even when there are two decision variables in the optimization: | The following would also cause this error, even when there are two decision variables in the optimization: | ||
− | + | <pre style="background:white; border:white; margin-left: 1em;"> | |
+ | DefineOptimization( | ||
decisions: All, | decisions: All, | ||
− | domain: | + | domain: Continuous(), Integer(), |
constraints: All, | constraints: All, | ||
− | maximize: Net_Profit ) | + | maximize: Net_Profit) |
+ | </pre> | ||
Here you might think that the [[Continuous]]() domain specification applies to the first decision in the model and [[Integer]]() applies to the second decision in the model -- but this is not how it works, and how would you know which is the first and which is the second decision anyway? What actually happens is that the first guess, [[Continuous]](), applies to the first decision ''parameter'' listed, which in this case is <code>All</code>. Hence, [[Continuous]]() applies to all decision variables, and the second domain parameter, [[Integer]](), is an extra, hence the error. | Here you might think that the [[Continuous]]() domain specification applies to the first decision in the model and [[Integer]]() applies to the second decision in the model -- but this is not how it works, and how would you know which is the first and which is the second decision anyway? What actually happens is that the first guess, [[Continuous]](), applies to the first decision ''parameter'' listed, which in this case is <code>All</code>. Hence, [[Continuous]]() applies to all decision variables, and the second domain parameter, [[Integer]](), is an extra, hence the error. | ||
− | = Remedy = | + | == Remedy == |
Remove the extra parameters from your «guess» or «domain» parameter to [[DefineOptimization]]. | Remove the extra parameters from your «guess» or «domain» parameter to [[DefineOptimization]]. | ||
− | We generally specify the guess and domain in the ''Initial Value'' and ''Domain'' attributes of the decision nodes themselves. These parameters to [[DefineOptimization]] are utilized when you want to override those attribute settings for a particular optimization. Thus, if you aren't using these parameters to over ride the attribute settings, just remove them entirely and set them in the decision variables' object | + | We generally specify the guess and domain in the ''Initial Value'' and ''Domain'' attributes of the decision nodes themselves. These parameters to [[DefineOptimization]] are utilized when you want to override those attribute settings for a particular optimization. Thus, if you aren't using these parameters to over ride the attribute settings, just remove them entirely and set them in the decision variables' [[object window]]s. |
− | |||
− | |||
+ | == See Also == | ||
+ | * [[Function Parameter Qualifiers]] | ||
* [[DefineOptimization]] | * [[DefineOptimization]] | ||
− | * | + | * [[Analytica Optimizer Guide]] |
+ | * [[Continuous]] | ||
+ | * [[Integer]] |
Latest revision as of 21:58, 9 March 2016
Error message examples
In the call to DefineOptimization, 4 values are being passed to the «guess» parameter where at most 2 are expected (since 2 values are specified for the «decisions» parameter) In the call to DefineOptimization, 3 values are being passed to the «domain» parameter where one is expected (since one value is specified for the «decisions» parameter)
Cause
You have listed too many values in the «guess» or «domain» parameter of DefineOptimization. These parameters are in positional correspondence with the parameters passed to the «decisions» parameter, and so it doesn't make sense for there to be more values passed to the «guess» parameter than there are parameters passed to the «decisions» parameter.
The following example results in this error:
DefineOptimization( decisions: Units_to_make, Labor_alloc, guess: 1, 2, 3, 4, constraints: Avail_labor, Meet_req_effort, maximize: Net_Profit)
In this definition, 1 is the guess for Units_to_make
, 2 is the guess for Labor_alloc
, but 3 and 4 are just extra and are the cause of this error.
The following would also cause this error, even when there are two decision variables in the optimization:
DefineOptimization( decisions: All, domain: Continuous(), Integer(), constraints: All, maximize: Net_Profit)
Here you might think that the Continuous() domain specification applies to the first decision in the model and Integer() applies to the second decision in the model -- but this is not how it works, and how would you know which is the first and which is the second decision anyway? What actually happens is that the first guess, Continuous(), applies to the first decision parameter listed, which in this case is All
. Hence, Continuous() applies to all decision variables, and the second domain parameter, Integer(), is an extra, hence the error.
Remedy
Remove the extra parameters from your «guess» or «domain» parameter to DefineOptimization.
We generally specify the guess and domain in the Initial Value and Domain attributes of the decision nodes themselves. These parameters to DefineOptimization are utilized when you want to override those attribute settings for a particular optimization. Thus, if you aren't using these parameters to over ride the attribute settings, just remove them entirely and set them in the decision variables' object windows.
Enable comment auto-refresher