
/* CGISimple - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
package ISimple;

import ptolemy.kernel.util.IllegalActionException;
import ptolemy.kernel.util.NameDuplicationException;
import ptolemy.actor.IOPort;
import ptolemy.actor.TypedCompositeActor;
import ptolemy.actor.TypedIOPort;
import ptolemy.actor.TypedIORelation;
import ptolemy.actor.lib.Const;
import ptolemy.actor.lib.gui.Display;
import ptolemy.actor.lib.ElementsToArray;
import ptolemy.actor.lib.Expression;
import ptolemy.actor.lib.hoc.IterateOverArray;
import ptolemy.actor.parameters.SharedParameter;
import ptolemy.data.expr.Parameter;
import ptolemy.data.expr.SingletonParameter;
import ptolemy.domains.sdf.kernel.SDFDirector;
import ptolemy.domains.sdf.kernel.SDFScheduler;
import ptolemy.kernel.ComponentPort;
import ptolemy.kernel.CompositeEntity;
import ptolemy.kernel.attributes.VersionAttribute;
import ptolemy.kernel.util.Settable;
import ptolemy.kernel.util.StringAttribute;
import ptolemy.kernel.util.Workspace;

public class CGISimple extends TypedCompositeActor
{
    public VersionAttribute A_createdBy;
    public SDFDirector ASDF_Director;
    public Parameter ASDF_Director_iterations;
    public Parameter ASDF_Director_vectorizationFactor;
    public Parameter ASDF_Director_allowDisconnectedGraphs;
    public Parameter ASDF_Director_allowRateChanges;
    public Parameter ASDF_Director_constrainBufferSizes;
    public Parameter ASDF_Director_period;
    public Parameter ASDF_Director_synchronizeToRealTime;
    public SharedParameter ASDF_Director_timeResolution;
    public SDFScheduler ASDF_Director_Scheduler;
    public Parameter ASDF_Director_Scheduler_constrainBufferSizes;
    public ComponentPort PCompositeActor_params;
    public ComponentPort PCompositeActor_output;
    public ComponentPort PElements_To_Array_input;
    public ComponentPort PElements_To_Array_output;
    public StringAttribute AElements_To_Array_class;
    public ComponentPort PCompositeActor_Iterate_Over_Array_output;
    public ComponentPort PCompositeActor_Iterate_Over_Array_input;
    public ComponentPort PExpression_output;
    public ComponentPort PExpression_input;
    public StringAttribute AExpression_expression;
    public Parameter AExpression_expression__hide;
    public Parameter Arelation_width;
    public Parameter Arelation2_width;
    public Parameter Arelation3_width;
    public ComponentPort PConstant_output;
    public ComponentPort PConstant_trigger;
    public SingletonParameter AConstant_trigger__showName;
    public Parameter AConstant_firingCountLimit;
    public Parameter AConstant_NONE;
    public Parameter AConstant_value;
    public StringAttribute AConstant_class;
    public ComponentPort PConstant2_output;
    public ComponentPort PConstant2_trigger;
    public SingletonParameter AConstant2_trigger__showName;
    public Parameter AConstant2_firingCountLimit;
    public Parameter AConstant2_NONE;
    public Parameter AConstant2_value;
    public StringAttribute AConstant2_class;
    public StringAttribute AConstant2_class_id;
    public ComponentPort PDisplay2_input;
    public Parameter Arelation4_width;
    
    public void __CGInit() throws IllegalActionException, NameDuplicationException {
	VersionAttribute versionattribute
	    = new VersionAttribute(this, "_createdBy");
	A_createdBy = versionattribute;
	Settable settable = versionattribute;
	settable.setExpression("9.0.devel");
	settable.validate();
	SDFDirector sdfdirector = new SDFDirector(this, "SDF Director");
	ASDF_Director = sdfdirector;
	ptolemy.kernel.util.Attribute attribute
	    = this.getAttribute("SDF Director.iterations");
	Parameter parameter = (Parameter) attribute;
	ASDF_Director_iterations = parameter;
	settable = (Settable) attribute;
	settable.setExpression("1");
	settable.validate();
	ptolemy.kernel.util.Attribute attribute_0_
	    = this.getAttribute("SDF Director.vectorizationFactor");
	parameter = (Parameter) attribute_0_;
	ASDF_Director_vectorizationFactor = parameter;
	Settable settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("1");
	settable_1_.validate();
	attribute_0_
	    = this.getAttribute("SDF Director.allowDisconnectedGraphs");
	parameter = (Parameter) attribute_0_;
	ASDF_Director_allowDisconnectedGraphs = parameter;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("false");
	settable_1_.validate();
	attribute_0_ = this.getAttribute("SDF Director.allowRateChanges");
	parameter = (Parameter) attribute_0_;
	ASDF_Director_allowRateChanges = parameter;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("false");
	settable_1_.validate();
	attribute_0_ = this.getAttribute("SDF Director.constrainBufferSizes");
	parameter = (Parameter) attribute_0_;
	ASDF_Director_constrainBufferSizes = parameter;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("true");
	settable_1_.validate();
	attribute_0_ = this.getAttribute("SDF Director.period");
	parameter = (Parameter) attribute_0_;
	ASDF_Director_period = parameter;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("0.0");
	settable_1_.validate();
	attribute_0_ = this.getAttribute("SDF Director.synchronizeToRealTime");
	parameter = (Parameter) attribute_0_;
	ASDF_Director_synchronizeToRealTime = parameter;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("false");
	settable_1_.validate();
	attribute_0_ = this.getAttribute("SDF Director.timeResolution");
	SharedParameter sharedparameter = (SharedParameter) attribute_0_;
	ASDF_Director_timeResolution = sharedparameter;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("1E-10");
	settable_1_.validate();
	attribute_0_ = this.getAttribute("SDF Director.Scheduler");
	SDFScheduler sdfscheduler = (SDFScheduler) attribute_0_;
	ASDF_Director_Scheduler = sdfscheduler;
	ptolemy.kernel.util.Attribute attribute_2_
	    = this.getAttribute("SDF Director.Scheduler.constrainBufferSizes");
	Parameter parameter_3_ = (Parameter) attribute_2_;
	ASDF_Director_Scheduler_constrainBufferSizes = parameter_3_;
	Settable settable_4_ = (Settable) attribute_2_;
	settable_4_.setExpression("constrainBufferSizes");
	settable_4_.validate();
	TypedCompositeActor typedcompositeactor
	    = new TypedCompositeActor(this, "CompositeActor");
	TypedIOPort typedioport
	    = new TypedIOPort(typedcompositeactor, "params");
	typedioport.setInput(true);
	typedioport.setMultiport(true);
	TypedIOPort typedioport_5_ = typedioport;
	PCompositeActor_params = typedioport_5_;
	typedioport = new TypedIOPort(typedcompositeactor, "output");
	typedioport.setOutput(true);
	TypedIOPort typedioport_6_ = typedioport;
	PCompositeActor_output = typedioport_6_;
	ElementsToArray elementstoarray
	    = new ElementsToArray(typedcompositeactor, "Elements To Array");
	ptolemy.kernel.Port port = elementstoarray.getPort("input");
	IOPort ioport = (IOPort) port;
	ioport.setInput(true);
	ioport.setMultiport(true);
	TypedIOPort typedioport_7_ = (TypedIOPort) port;
	PElements_To_Array_input = typedioport_7_;
	ptolemy.kernel.Port port_8_ = elementstoarray.getPort("output");
	ioport = (IOPort) port_8_;
	ioport.setOutput(true);
	TypedIOPort typedioport_9_ = (TypedIOPort) port_8_;
	PElements_To_Array_output = typedioport_9_;
	StringAttribute stringattribute
	    = new StringAttribute(elementstoarray, "class");
	AElements_To_Array_class = stringattribute;
	Settable settable_10_ = stringattribute;
	settable_10_.setExpression("ptolemy.actor.lib.ElementsToArray");
	settable_10_.validate();
	IterateOverArray iterateoverarray
	    = new IterateOverArray(typedcompositeactor, "Iterate Over Array");
	IterateOverArray.IteratePort iterateport
	    = new IterateOverArray.IteratePort(iterateoverarray, "output");
	iterateport.setOutput(true);
	IterateOverArray.IteratePort iterateport_11_ = iterateport;
	PCompositeActor_Iterate_Over_Array_output = iterateport_11_;
	iterateport
	    = new IterateOverArray.IteratePort(iterateoverarray, "input");
	iterateport.setInput(true);
	IterateOverArray.IteratePort iterateport_12_ = iterateport;
	PCompositeActor_Iterate_Over_Array_input = iterateport_12_;
	Expression expression = new Expression(iterateoverarray, "Expression");
	ptolemy.kernel.Port port_13_ = expression.getPort("output");
	ioport = (IOPort) port_13_;
	ioport.setOutput(true);
	TypedIOPort typedioport_14_ = (TypedIOPort) port_13_;
	PExpression_output = typedioport_14_;
	typedioport = new TypedIOPort(expression, "input");
	typedioport.setInput(true);
	TypedIOPort typedioport_15_ = typedioport;
	PExpression_input = typedioport_15_;
	ptolemy.kernel.util.Attribute attribute_16_
	    = iterateoverarray.getAttribute("Expression.expression");
	stringattribute = (StringAttribute) attribute_16_;
	AExpression_expression = stringattribute;
	Settable settable_17_ = (Settable) attribute_16_;
	settable_17_.setExpression("input + ' - ' + iterationCount");
	settable_17_.validate();
	attribute_0_
	    = iterateoverarray.getAttribute("Expression.expression._hide");
	Parameter parameter_18_ = (Parameter) attribute_0_;
	AExpression_expression__hide = parameter_18_;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("true");
	settable_1_.validate();
	TypedIORelation typediorelation
	    = new TypedIORelation(iterateoverarray, "relation");
	attribute_0_ = iterateoverarray.getAttribute("relation.width");
	parameter_18_ = (Parameter) attribute_0_;
	Arelation_width = parameter_18_;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("Auto");
	settable_1_.validate();
	TypedIORelation typediorelation_19_
	    = new TypedIORelation(iterateoverarray, "relation2");
	attribute_0_ = iterateoverarray.getAttribute("relation2.width");
	parameter_18_ = (Parameter) attribute_0_;
	Arelation2_width = parameter_18_;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("Auto");
	settable_1_.validate();
	iterateport_11_.insertLink(0, typediorelation);
	iterateport_12_.insertLink(0, typediorelation_19_);
	typedioport_14_.insertLink(0, typediorelation);
	typedioport_15_.insertLink(0, typediorelation_19_);
	typediorelation_19_
	    = new TypedIORelation(typedcompositeactor, "relation");
	attribute_0_ = typedcompositeactor.getAttribute("relation.width");
	parameter_18_ = (Parameter) attribute_0_;
	Arelation_width = parameter_18_;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("Auto");
	settable_1_.validate();
	typediorelation
	    = new TypedIORelation(typedcompositeactor, "relation2");
	attribute_0_ = typedcompositeactor.getAttribute("relation2.width");
	parameter_18_ = (Parameter) attribute_0_;
	Arelation2_width = parameter_18_;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("Auto");
	settable_1_.validate();
	TypedIORelation typediorelation_20_
	    = new TypedIORelation(typedcompositeactor, "relation3");
	attribute_0_ = typedcompositeactor.getAttribute("relation3.width");
	parameter_18_ = (Parameter) attribute_0_;
	Arelation3_width = parameter_18_;
	settable_1_ = (Settable) attribute_0_;
	settable_1_.setExpression("Auto");
	settable_1_.validate();
	typedioport_5_.insertLink(0, typediorelation_19_);
	typedioport_6_.insertLink(0, typediorelation_20_);
	typedioport_7_.insertLink(0, typediorelation_19_);
	typedioport_9_.insertLink(0, typediorelation);
	iterateport_11_.insertLink(0, typediorelation_20_);
	iterateport_12_.insertLink(0, typediorelation);
	Const var_const = new Const(this, "Constant");
	port_8_ = var_const.getPort("output");
	IOPort ioport_21_ = (IOPort) port_8_;
	ioport_21_.setOutput(true);
	typedioport = (TypedIOPort) port_8_;
	PConstant_output = typedioport;
	ptolemy.kernel.Port port_22_ = var_const.getPort("trigger");
	ioport_21_ = (IOPort) port_22_;
	ioport_21_.setInput(true);
	ioport_21_.setMultiport(true);
	TypedIOPort typedioport_23_ = (TypedIOPort) port_22_;
	PConstant_trigger = typedioport_23_;
	attribute_16_ = this.getAttribute("Constant.trigger._showName");
	SingletonParameter singletonparameter
	    = (SingletonParameter) attribute_16_;
	AConstant_trigger__showName = singletonparameter;
	settable_17_ = (Settable) attribute_16_;
	settable_17_.setExpression("true");
	settable_17_.validate();
	attribute_16_ = this.getAttribute("Constant.firingCountLimit");
	Parameter parameter_24_ = (Parameter) attribute_16_;
	AConstant_firingCountLimit = parameter_24_;
	settable_17_ = (Settable) attribute_16_;
	settable_17_.setExpression("NONE");
	settable_17_.validate();
	ptolemy.kernel.util.Attribute attribute_25_
	    = this.getAttribute("Constant.NONE");
	parameter_18_ = (Parameter) attribute_25_;
	AConstant_NONE = parameter_18_;
	settable_17_ = (Settable) attribute_25_;
	settable_17_.setExpression("0");
	settable_17_.validate();
	attribute_25_ = this.getAttribute("Constant.value");
	parameter_18_ = (Parameter) attribute_25_;
	AConstant_value = parameter_18_;
	settable_17_ = (Settable) attribute_25_;
	settable_17_.setExpression("1");
	settable_17_.validate();
	StringAttribute stringattribute_26_
	    = new StringAttribute(var_const, "class");
	AConstant_class = stringattribute_26_;
	settable_17_ = stringattribute_26_;
	settable_17_.setExpression("ptolemy.actor.lib.Const");
	settable_17_.validate();
	var_const = new Const(this, "Constant2");
	port_22_ = var_const.getPort("output");
	ioport_21_ = (IOPort) port_22_;
	ioport_21_.setOutput(true);
	typedioport_23_ = (TypedIOPort) port_22_;
	PConstant2_output = typedioport_23_;
	ptolemy.kernel.Port port_27_ = var_const.getPort("trigger");
	ioport_21_ = (IOPort) port_27_;
	ioport_21_.setInput(true);
	ioport_21_.setMultiport(true);
	typedioport_15_ = (TypedIOPort) port_27_;
	PConstant2_trigger = typedioport_15_;
	attribute_25_ = this.getAttribute("Constant2.trigger._showName");
	SingletonParameter singletonparameter_28_
	    = (SingletonParameter) attribute_25_;
	AConstant2_trigger__showName = singletonparameter_28_;
	Settable settable_29_ = (Settable) attribute_25_;
	settable_29_.setExpression("true");
	settable_29_.validate();
	attribute_25_ = this.getAttribute("Constant2.firingCountLimit");
	Parameter parameter_30_ = (Parameter) attribute_25_;
	AConstant2_firingCountLimit = parameter_30_;
	settable_29_ = (Settable) attribute_25_;
	settable_29_.setExpression("NONE");
	settable_29_.validate();
	ptolemy.kernel.util.Attribute attribute_31_
	    = this.getAttribute("Constant2.NONE");
	parameter_24_ = (Parameter) attribute_31_;
	AConstant2_NONE = parameter_24_;
	settable_29_ = (Settable) attribute_31_;
	settable_29_.setExpression("0");
	settable_29_.validate();
	attribute_31_ = this.getAttribute("Constant2.value");
	parameter_24_ = (Parameter) attribute_31_;
	AConstant2_value = parameter_24_;
	settable_29_ = (Settable) attribute_31_;
	settable_29_.setExpression("2");
	settable_29_.validate();
	stringattribute_26_ = new StringAttribute(var_const, "class");
	AConstant2_class = stringattribute_26_;
	settable_29_ = stringattribute_26_;
	settable_29_.setExpression("ptolemy.actor.lib.Const");
	settable_29_.validate();
	stringattribute_26_ = new StringAttribute(stringattribute_26_, "id");
	AConstant2_class_id = stringattribute_26_;
	settable_29_ = stringattribute_26_;
	settable_29_.setExpression("urn:lsid:kepler-project.org:class:877:1");
	settable_29_.validate();
	Display discard = new Display(this, "Display2");
	port_27_ = discard.getPort("input");
	ioport = (IOPort) port_27_;
	ioport.setInput(true);
	ioport.setMultiport(true);
	typedioport_15_ = (TypedIOPort) port_27_;
	PDisplay2_input = typedioport_15_;
	typediorelation_19_ = new TypedIORelation(this, "relation");
	attribute_31_ = this.getAttribute("relation.width");
	Parameter parameter_32_ = (Parameter) attribute_31_;
	Arelation_width = parameter_32_;
	Settable settable_33_ = (Settable) attribute_31_;
	settable_33_.setExpression("Auto");
	settable_33_.validate();
	typediorelation = new TypedIORelation(this, "relation2");
	attribute_31_ = this.getAttribute("relation2.width");
	parameter_32_ = (Parameter) attribute_31_;
	Arelation2_width = parameter_32_;
	settable_33_ = (Settable) attribute_31_;
	settable_33_.setExpression("Auto");
	settable_33_.validate();
	typediorelation_20_ = new TypedIORelation(this, "relation4");
	attribute_31_ = this.getAttribute("relation4.width");
	parameter_32_ = (Parameter) attribute_31_;
	Arelation4_width = parameter_32_;
	settable_33_ = (Settable) attribute_31_;
	settable_33_.setExpression("Auto");
	settable_33_.validate();
	typedioport_5_.insertLink(0, typediorelation_19_);
	typedioport_5_.insertLink(1, typediorelation);
	typedioport_6_.insertLink(0, typediorelation_20_);
	typedioport.insertLink(0, typediorelation_19_);
	typedioport_23_.insertLink(0, typediorelation);
	typedioport_15_.insertLink(0, typediorelation_20_);
    }
    
    public CGISimple() {
        try {
        	__CGInit();
        } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e.toString());
        }
    }
    
    public CGISimple(Workspace workspace) {
	super(workspace);
        try {
        	__CGInit();
        } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e.toString());
        }
    }
    
    public CGISimple(CompositeEntity compositeentity, String string)  throws IllegalActionException, NameDuplicationException {
	super(compositeentity, string);
        try {
        	__CGInit();
        } catch (Exception e) {
                e.printStackTrace();
                throw new RuntimeException(e.toString());
        }
    }
}
