Beispiel #1
0
        public RESEAUX_1()
        {
            outsider   = new Manager();
            market     = new Market();
            clock      = new Clock();
            weather_bx = new Weather("Bruxelles", clock);
            weather_os = new Weather("Ostende", clock);

            // CREATION CENTRALES
            PowerPlant doel                = outsider.CreateNewNuclearPowerPlant("doel", market);
            PowerPlant parc_eolien_os      = outsider.CreateNewWindFarm("parc éolien de Ostende", weather_os);
            PowerPlant esso                = outsider.CreateNewGasPowerPlant("station à gaz esso", market);
            PowerPlant centrale_solaire_bx = outsider.CreateNewSolarPowerPlant("centrale solaire de bruxelles", weather_bx);
            PowerPlant shop1               = outsider.CreateNewPurchasedAbroad("shop1", market);

            // CREATION CONSOMATEUR
            Consumer bx = outsider.CreateNewCity("Bruxelles", 10, weather_bx);
            Consumer os = outsider.CreateNewCity("Ostende", 7, weather_os);

            Consumer ad = outsider.CreateNewEntreprise("Audi", 2);
            Consumer bm = outsider.CreateNewEntreprise("BMW", 5);
            Consumer vw = outsider.CreateNewEntreprise("VolksWagen", 3);
            Consumer mc = outsider.CreateNewEntreprise("Mercedes", 4);

            //CREATION DES PAIRES NOEUDS MID
            ConcentrationNode midC1 = outsider.CreateNewConcentrationNode("midC1");
            ConcentrationNode midC2 = outsider.CreateNewConcentrationNode("midC2");
            DistributionNode  midD1 = outsider.CreateNewDistributionNode("midD1");
            DistributionNode  midD2 = outsider.CreateNewDistributionNode("midD2");

            //Liaison des noeuds mid entre eux
            outsider.ConnectConcentrationToDistributionNode(midC1, midD1);
            outsider.ConnectConcentrationToDistributionNode(midC2, midD2);
            //Liaison des centrales aux noeuds mid
            outsider.ConnectDistributionToConcentrationNode("LINE_C1.1", doel.GetOutputNode, midC1);
            outsider.ConnectDistributionToConcentrationNode("LINE_C1.2", parc_eolien_os.GetOutputNode, midC1);
            outsider.ConnectDistributionToConcentrationNode("LINE_C2.1", parc_eolien_os.GetOutputNode, midC2);
            outsider.ConnectDistributionToConcentrationNode("LINE_C2.2", esso.GetOutputNode, midC2);
            outsider.ConnectDistributionToConcentrationNode("LINE_C2.3", centrale_solaire_bx.GetOutputNode, midC2);
            ///magasins
            outsider.ConnectDistributionToConcentrationNode("LINE_SHOPC1", shop1.GetOutputNode, midC1);
            outsider.ConnectDistributionToConcentrationNode("LINE_SHOPC2", shop1.GetOutputNode, midC2);

            //liaison des noeuds mid aux consumers
            outsider.ConnectDistributionToConcentrationNode("LINE_D1.1", midD1, bx.GetInputNode);
            outsider.ConnectDistributionToConcentrationNode("LINE_D1.2", midD1, os.GetInputNode);
            outsider.ConnectDistributionToConcentrationNode("LINE_D1.3", midD1, ad.GetInputNode);
            outsider.ConnectDistributionToConcentrationNode("LINE_D1.4", midD1, bm.GetInputNode);

            outsider.ConnectDistributionToConcentrationNode("LINE_D2.1", midD2, ad.GetInputNode);
            outsider.ConnectDistributionToConcentrationNode("LINE_D2.2", midD2, bm.GetInputNode);
            outsider.ConnectDistributionToConcentrationNode("LINE_D2.3", midD2, vw.GetInputNode);
            outsider.ConnectDistributionToConcentrationNode("LINE_D2.4", midD2, mc.GetInputNode);
        }
Beispiel #2
0
        public Battery(string name, PowerPlant input)
        {
            this.name      = name;
            this.input     = input;
            maximum_charge = 1000;

            charge = 0;     // batterie vide lors de sa construction

            alert_message = "";
            outputLine    = new Line(name + "_outputLine");
            outputLine.SetPriorityLevel(PLBattery);
            outputLine.SetIsBatteryLine(true);
        }
Beispiel #3
0
        ///CREATION DE NOUVELLE CENTRALE
        public PowerPlant CreateNewPowerPlant(string name)
        {
            foreach (PowerPlant pp in PowerPlantList)
            {
                if (pp.GetName == name)
                {
                    Console.WriteLine("La centrale nommée {0} existe déjà. Entrez un nouveau nom :", name);
                    string newName = Console.ReadLine();
                    return(CreateNewPowerPlant(newName));
                }
            }
            PowerPlant NewPowerPlant = new PowerPlant(name);

            PowerPlantList.Add(NewPowerPlant);
            NodeList.Add(NewPowerPlant.GetOutputNode);
            LineList.Add(NewPowerPlant.GetOutPutLine);
            return(NewPowerPlant);
        }
Beispiel #4
0
 public void SetMyPowerPlant(PowerPlant p)
 {
     myPowerPlant = p;
 }