* created for the given port, or the given value is not an acceptable.
* @see #getRateVariable(Port, String)
*/
public static void setRateVariable(Port port, String name, int value)
throws IllegalActionException {
Variable rateParameter = (Variable) port.getAttribute(name);
if (rateParameter == null) {
try {
String altName = "_" + name;
rateParameter = (Variable) port.getAttribute(altName);
if (rateParameter == null) {
rateParameter = new Parameter(port, altName);
rateParameter.setVisibility(Settable.NOT_EDITABLE);
rateParameter.setPersistent(false);
}
} catch (KernelException ex) {
throw new InternalErrorException(port, ex, "Should not occur");
}
}
rateParameter.setToken(new IntToken(value));
}