Exemplo n.º 1
0
        public void AddMachines(List <DESMachine> tasks)
        {
            machines.Clear();
            machines.AddRange(tasks);
            var process = new Process(this, GetTasks);

            process.Activate(this);
        }
Exemplo n.º 2
0
    /*
     * static void Main(string[] args)
     * {
     *  Program p = new Program();
     *  Task[] tasks = new Task[6];
     *  for (int i = 0; i < tasks.Length - 1; i++)
     *  {
     *      tasks[i] = new Truck(p);
     *  }
     *
     *  Process process = new Process(p, p.ResupplyFuel);
     *  process.Activate(null);
     *  tasks[tasks.Length - 1] = process;
     *
     *  p.Run(tasks);
     * }
     */

    static void Main(string[] args)
    {
        Program p = new Program();

        Task[] tasks = new Task[6];
        for (int i = 0; i < 5; i++)
        {
            Task t = new Truck(p);
            t.Activate(null, 0L, p.FuelDepot);
        }

        Process process = new Process(p, p.ResupplyFuel);

        process.Activate(null);
//        tasks[tasks.Length - 1] = process;

        p.Run();

        //      p.Run(tasks);
    }
Exemplo n.º 3
0
    private Greetings()
    {
        Process process = new Process(this, SayHello);

        process.Activate(this);
    }