ERROR: Can not evaluate parametric in constraint

Moderator: Moderators

ERROR: Can not evaluate parametric in constraint

Postby tpen3219 » Mon May 20, 2013 6:43 pm

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)
tpen3219
Forum Beginner
Forum Beginner
 
Posts: 93
Posts Rating:3
Joined: Fri Nov 04, 2011 11:57 am

Re: ERROR: Can not evaluate parametric in constraint

Postby tpen3219 » Mon May 20, 2013 11:35 pm

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.
tpen3219
Forum Beginner
Forum Beginner
 
Posts: 93
Posts Rating:3
Joined: Fri Nov 04, 2011 11:57 am

Re: ERROR: Can not evaluate parametric in constraint

Postby kritsana_u » Wed May 22, 2013 11:26 pm

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.
kritsana_u
Forum Expert
Forum Expert
 
Posts: 116
Posts Rating:3
Joined: Wed Jan 27, 2010 3:02 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests