output = new TypedIOPort(this, "output", false, true);
output.setTypeEquals(BaseType.DOUBLE);
// Create the parameters.
length = new Parameter(this, "length", new IntToken(100));
length.setTypeEquals(BaseType.INT);
// The initial trace is used to make the sketched value
// persistent, and also to provide an initial trace when
// an instance of the actor is first dragged onto a model.
initialTrace = new Parameter(this, "initialTrace");
initialTrace.setExpression("repeat(length, 0.0)");
initialTrace.setTypeEquals(new ArrayType(BaseType.DOUBLE));
initialTrace.setVisibility(Settable.EXPERT);
periodic = new Parameter(this, "periodic", BooleanToken.TRUE);
periodic.setTypeEquals(BaseType.BOOLEAN);
yBottom = new Parameter(this, "yBottom", new DoubleToken(-1.0));
yBottom.setTypeEquals(BaseType.DOUBLE);
yTop = new Parameter(this, "yTop", new DoubleToken(1.0));
yTop.setTypeEquals(BaseType.DOUBLE);
runOnModification = new Parameter(this, "runOnModification",
BooleanToken.FALSE);
runOnModification.setTypeEquals(BaseType.BOOLEAN);
// Fill on wrapup no longer makes sense.
// NOTE: This gets overridden with zero if the MoML file
// gives the value of this variable. Hence, we need to
// reset later as well.
fillOnWrapup.setToken(BooleanToken.FALSE);
fillOnWrapup.setVisibility(Settable.NONE);
// Starting data set for producing plots is now always 1.
// NOTE: This gets overridden with zero if the MoML file
// gives the value of this variable. Hence, we need to
// reset later as well.
startingDataset.setToken(_one);
startingDataset.setVisibility(Settable.NONE);
// Set the initial token production parameter of the
// output port so that this can be used in SDF in feedback
// loops.
Parameter tokenInitProduction = new Parameter(output,
"tokenInitProduction");
// Use an expression here so change propagate.
tokenInitProduction.setExpression("length");
}