Page 1 of 1

ERROR: Can not evaluate parametric in constraint

PostPosted: Mon May 20, 2013 6:43 pm
by tpen3219
I could use some help figuring out what is the problem with this constraint. When the simulation encounters this error it exits the parametric diagram.
2013-05-20 17:21:22,745 ERROR: Can not evaluate parametric in constraint totalMovementCalc Check the visible of property and make sure the direction of constraint is correct +totalMovementCalc : TotalMovement [1]

(All the constraints and values from previous steps are correct as are the input values.)

The constraint is intended to test values to determine which value to use for the output; for example (If x >= y) * (w >= z) * peoplePerMinute in which true = 1 and false = 0.

totalMovement = ((totalOutOcc >= totalInAvailable) * (totalInAvailable >= peoplePerMinute) * peoplePerMinute)+
((totalOutOcc >= totalInAvailable) * (totalInAvailable < peoplePerMinute) * totalInAvailable)+
((totalOutOcc < totalInAvailable) * (totalOutOcc >= peoplePerMinute) * peoplePerMinute)+
((totalOutOcc < totalInAvailable) * (totalOutOcc < peoplePerMinute) * totalOutOcc)

I have used similar constraints successfully in other parts of the same diagram:
areaDensity = (occupancy > 0) * ((length * width) / (occupancy * personConstant))
timeQueuing =(occupancy > 0) * (occupancy / numberOfPortals / flowCalc)

Re: ERROR: Can not evaluate parametric in constraint

PostPosted: Mon May 20, 2013 11:35 pm
by tpen3219
I found the problem. The constraint specification field does not like line breaks. The script was formatted with an external editor and line breaks added to help with readability. The script was copied into the constraint specification.
When I removed the line breaks the parametric constraint worked.

Re: ERROR: Can not evaluate parametric in constraint

PostPosted: Wed May 22, 2013 11:26 pm
by kritsana_u
Hi,

Cameo Simulation Toolkit passes the math expression as a string obtained from the specification of the constraint of the constraint block, to the math engine for solving. For the version 17.0.4, both built-in math engine and MATLAB math engine, do not support the new line character in the expression. So, if you expression contains the new line character the expression cannot be executed.

Sorry for your inconvenience.

Kritsana U.