/* Copyright 1999 Arizona Board of regents on behalf of * The University of Arizona * All Rights Reserved * (USE & RESTRICTION - Please read COPYRIGHT file) * * Version : DEVSJAVA2.6 * Date : 04-15-00 */ package SimpArc; import java.awt.*; import genDevs.modeling.*; import genDevs.simulation.*; import GenCol.*; import simView.*; import pulseExpFrames.*; ////////////////////////// class timedControl extends myTimer{ IODevs sp; public timedControl(String nm,double duration){ super(nm,duration); } public void changeProcessor(){ if (time <= 100) sp = new proc("proc",25); else if (time <=200) sp = new DandC3("d",29); else if (time <=300) sp = new DandC3("dc3",10); else if (time <=400) sp = new procQ("pq",30); else if (time <=500) sp = new pipeLine("p",30,3); else if (time <=600) sp = new pipeLine("p",30,3); else if (time <=700) sp = new multiServer("m",30,3); else if (time <=800) sp = new multiServer("m",40,4); else { } if (sp instanceof ViewableDigraph) ((ViewableDigraph)sp).setBlackBox(true); addProcessor(); } public void addProcessor(){ addModel(sp); addCoupling("ExpFrame","out",sp.getName(),"in"); addCoupling(sp.getName(),"out","ExpFrame","in"); } public void removeProcessor(){ if (sp == null)return; removeModel(sp.getName()); removeCoupling("ExpFrame","out",sp.getName(),"in"); removeCoupling(sp.getName(),"out","ExpFrame","in"); } public void deltint() { time += sigma; removeProcessor(); if (time >=900) passivate(); else{ changeProcessor(); holdIn("active",duration); } } } public class efpVS extends ViewableDigraph { public efpVS (){ super("efpVS"); ViewableDigraph expf = new ef("ExpFrame",10,10000); expf.setBlackBox(true); add(expf); ViewableAtomic tc = new timedControl("tc",100); add(tc); addCoupling(this,"start",expf,"start"); addCoupling(this,"stop",expf,"stop"); } /** * Automatically generated by the SimView program. * Do not edit this manually, as such changes will get overwritten. */ public void layoutForSimView() { ComputeLayout = false; preferredSize = new Dimension(625, 341); ((ViewableComponent)withName("d")).setPreferredLocation(new Point(50, 50)); ((ViewableComponent)withName("ExpFrame")).setPreferredLocation(new Point(163, 109)); ((ViewableComponent)withName("tc")).setPreferredLocation(new Point(318, 178)); } }