//ctIncS.input.link(ctIncR1);
ctIncGFi.link(ctIncR1);
ctIncSt.link(ctIncR1);
CTEmbeddedDirector ctIncDir = new CTEmbeddedDirector(ctInc, "CTIncDir");
//ctIncDir.addDebugListener(dbl);
CTCompositeActor ctDec = new CTCompositeActor(hs, "Decreasing");
//ctDec.addDebugListener(dbl);
//ZeroOrderHold ctDecH = new ZeroOrderHold(ctDec, "Hold");
Integrator ctDecI = new Integrator(ctDec, "Integrator");
Scale ctGain = new Scale(ctDec, "Gain");
ZeroCrossingDetector ctDecD = new ZeroCrossingDetector(ctDec, "ZD");
Expression ctDecGF = new Expression(ctDec, "EXPRESSION");
TypedIOPort ctDecGFi = (TypedIOPort) ctDecGF.newPort("in");
ctDecGFi.setInput(true);
ctDecGFi.setTypeEquals(BaseType.DOUBLE);
ctDecGF.output.setTypeEquals(BaseType.DOUBLE);
ctDecGF.expression.setExpression("in + 0.0");
// the ports
TypedIOPort ctDecIn = (TypedIOPort) ctDec.newPort("input");
ctDecIn.setInput(true);
ctDecIn.setTypeEquals(BaseType.DOUBLE);
TypedIOPort ctDecOut = (TypedIOPort) ctDec.newPort("output");
ctDecOut.setOutput(true);
ctDecOut.setTypeEquals(BaseType.DOUBLE);
TypedIOPort ctDecSt = (TypedIOPort) ctDec.newPort("state");
ctDecSt.setOutput(true);
ctDecSt.setTypeEquals(BaseType.DOUBLE);
TypedIOPort ctDecTr = (TypedIOPort) ctDec.newPort("trig");
ctDecTr.setOutput(true);
ctDecTr.setTypeEquals(BaseType.DOUBLE);
// connect ctDec
//ctDec.connect(ctDecIn, ctDecH.input);
//ctDec.connect(ctDecH.output, ctGain.input);
ctDec.connect(ctDecIn, ctGain.input);
ctDec.connect(ctGain.output, ctDecI.input);
Relation ctDecR2 = ctDec.newRelation("R2");
ctDecGF.output.link(ctDecR2);
ctDecD.trigger.link(ctDecR2);
ctDecTr.link(ctDecR2);
ctDec.connect(ctDecD.output, ctDecOut);
//ctDec.connect(ctDecS.output, ctDecSt);
TypedIORelation ctDecR1 = (TypedIORelation) ctDec
.newRelation("CTDecR1");
ctDecI.output.link(ctDecR1);
//ctDecS.input.link(ctDecR1);
ctDecGFi.link(ctDecR1);
ctDecSt.link(ctDecR1);
CTEmbeddedDirector ctDecDir = new CTEmbeddedDirector(ctDec, "CTDecDir");
//ctDecDir.addDebugListener(dbl);
ctrlInc.refinementName.setExpression("Increasing");
ctrlDec.refinementName.setExpression("Decreasing");