Exemple #1
0
 //------------------------------------------------------------------------------
 // temporary until we have more data, better data
 //
 //
 //------------------------------------------------------------------------------
 private void InitYearTwo()
 {
     //init more machine nodes for the next year
     for (int i = 1; i <= QUARTERS; i++)
     {
         MachineNode m = new MachineNode(1, i);
         machineNodes.Add(m);
     }
     //transfer all the same classes to the set of machine nodes
     for (int i = 4; i < 8; i++)
     {
         MachineNode oldMn = machineNodes[i - 4];
         MachineNode newMn = machineNodes[i];
         for (int j = 0; j < oldMn.GetMachines().Count; j++)
         {
             Machine oldMachine = oldMn.GetMachines()[j];
             Machine newMachine = new Machine(oldMachine);
             newMachine.SetYear(1);
             newMn.AddMachine(newMachine);
         }
     }
 }
 void normalizeMachines()
 {   //transfer all the same classes to the set of machine nodes
     if (quarters >= yearlength)
     {
         for (int i = yearlength; i < quarters; i++)
         {
             MachineNode oldMn = machineNodes[i % yearlength];
             MachineNode newMn = machineNodes[i];
             for (int j = 0; j < oldMn.GetMachines().Count; j++)
             {
                 Machine oldMachine = oldMn.GetMachines()[j];
                 Machine newMachine = new Machine(oldMachine);
                 newMachine.SetYear(i / yearlength);
                 newMn.AddMachine(newMachine);
             }
         }
         return;
     }
     else
     {
         return;
     }
 }