Ejemplo n.º 1
0
 public void addNextComponent(IComponent nextComponent)
 {
     Contract.Requires(nextComponent != null, "next component can't be null");
     this.dequeueBehaviour = new Forward(this.queue, nextComponent);
     this.nextComponent = nextComponent;
     this.initialized = true;
 }
 public void addNextComponent(IComponent nextComponent)
 {
     //Contract.Requires(this.initialized == false, "System is already initialized");
     Contract.Requires(nextComponent != null, "next component can't be null");
     this.dequeueBehaviour = new Forward(this.queue, nextComponent);
     this.nextComponent = nextComponent;
     this.initialized = true;
 }
Ejemplo n.º 3
0
 public Truck(int dequeueDeltaMiliSeconds, List<IProblem> problems, int id)
 {
     this.queue = new FIFOQueue();
     this.name = "Trucky number: " + id.ToString();
     this.enqueueBehaviour = new Receive(this.queue, dequeueDeltaMiliSeconds);
     this.initialized = false;
     this.problems = problems;
     this.stuck = false;
 }
 public SortingMachine(int dequeueDeltaMiliSeconds, List<IProblem> problems, int id)
 {
     this.queue = new FIFOQueue();
     this.sinks = new List<IComponent>();
     this.name = "Sorting m. number: " + id.ToString();
     this.enqueueBehaviour = new Receive(this.queue, dequeueDeltaMiliSeconds);
     this.initialized = false;
     this.problems = problems;
     this.stuck = false;
     this.allSinks = null;
 }
 public void addNextComponent(IComponent nextComponent)
 {
     //Contract.Requires(this.initialized == false, "System is already initialized");
     //Contract.Requires(this.sinks.Count < 2, "Splitter only supports two \"outputs\"");
     Contract.Requires(nextComponent != null, "next component can't be null");
     this.sinks.Add(nextComponent);
     if (this.sinks.Count == 2)
     {
         this.dequeueBehaviour = new SortingForwarder(this.queue, this.sinks);
         this.initialized = true;
     }
 }
 public ConveyorBeltSplitter(int dequeueDeltaMiliSeconds, List<IProblem> problems, int id)
 {
     this.sinks = new List<IComponent>();
     this.queue = new FIFOQueue();
     this.name = "Splitter number: " + id.ToString();
     this.enqueueBehaviour = new Receive(this.queue, dequeueDeltaMiliSeconds);
     this.initialized = false;
     this.initialized_thread = false;
     this.problems = problems;
     this.stuck = false;
     this.allSinks = null;
 }
 public void SetInitialized()
 {
     if (this.sinks.Count >= 2)
     {
         this.dequeueBehaviour = new SortingForwarder(this.queue, this.sinks);
     }
 }