private void _init() throws IllegalActionException {
try {
input = new TypedIOPort(this, "input", true, false);
modelString = new TypedIOPort(this, "modelString", true, false);
modelString.setTypeEquals(BaseType.STRING);
defaultValue = new Parameter(this, "defaultValue", new IntToken(0));
output = new TypedIOPort(this, "output", false, true);
output.setTypeAtLeast(defaultValue);
refresh = new Parameter(this, "refresh", new BooleanToken(true));
refresh.setTypeEquals(BaseType.BOOLEAN);
connectPorts = new Parameter(this, "connectPorts",
new BooleanToken(true));
connectPorts.setTypeEquals(BaseType.BOOLEAN);
// create a defaultDirector. Without this director, it may get
// an infinite loop when preinitialize, etc. is called in case the
// specified director is not successfully constructed. Even when the
// specified director is construced successfully, it cannot be removed
// in wrapup() without this default director.
//The default director may not work when we need multi tokens to fire
//the inside model because the receiver it creates is an instance of
//Mailbox, which can only hold one token. In this case, specify a proper
//director using the <i>director<i> parameter.
new Director(this, "defaultDirector");
director = new Parameter(this, "director", new StringToken(
"ptolemy.actor.Director"));
setClassName("ptolemy.actor.lib.hoc.MobileModel");
} catch (NameDuplicationException e) {
// This should not be thrown.
throw new InternalErrorException(e);