internal static PlantHomeModel Create(SolarPlant plant) { return new PlantHomeModel() { Plant = plant }; }
public static Network exampleNet() { SimpleMarketSimulation france_market = new SimpleMarketSimulation(); SimpleWeatherSimulation france_weather = new SimpleWeatherSimulation(0, 0); GasPlant myGas = new GasPlant(1000, 3, france_market); SolarPlant mySun = new SolarPlant(0, 100, france_weather); BuyElectricity myBuy = new BuyElectricity(0, 0, france_market); City myCity = new City(800); Company myCompany = new Company(400); Dissipaters myDisip = new Dissipaters(0); DistribNode myD1 = new DistribNode(); Wire w1 = new Wire(myGas, myD1, 1000); DistribNode myD2 = new DistribNode(); Wire w2 = new Wire(mySun, myD2, 1000); DistribNode myD3 = new DistribNode(); Wire w3 = new Wire(myBuy, myD3, 1000); Double[] distribution = { 0.33333, 0.33333, 0.33333 }; List <Double> distributionList = new List <Double>(); distributionList.AddRange(distribution); myD1.setDistribution(distributionList); myD2.setDistribution(distributionList); myD3.setDistribution(distributionList); ConcentNode myC1 = new ConcentNode(); Wire w4 = new Wire(myCity, myC1, 1000); ConcentNode myC2 = new ConcentNode(); Wire w5 = new Wire(myCompany, myC2, 1000); ConcentNode myC3 = new ConcentNode(); Wire w6 = new Wire(myDisip, myC3, 1000); Wire w7 = new Wire(myD1, myC1, 1000); Wire w8 = new Wire(myD1, myC2, 1000); Wire w9 = new Wire(myD1, myC3, 1000); Wire w10 = new Wire(myD2, myC1, 1000); Wire w11 = new Wire(myD2, myC2, 1000); Wire w12 = new Wire(myD2, myC3, 1000); Wire w13 = new Wire(myD3, myC1, 1000); Wire w14 = new Wire(myD3, myC2, 1000); Wire w15 = new Wire(myD3, myC3, 1000); Producer[] prod = { myGas, mySun, myBuy }; List <Producer> prodList = new List <Producer>(); prodList.AddRange(prod); Consumer[] cons = { myCity, myCompany, myDisip }; List <Consumer> consList = new List <Consumer>(); consList.AddRange(cons); DistribNode[] distrib = { myD1, myD2, myD3 }; List <DistribNode> distribList = new List <DistribNode>(); distribList.AddRange(distrib); ConcentNode[] concent = { myC1, myC2, myC3 }; List <ConcentNode> concentList = new List <ConcentNode>(); concentList.AddRange(concent); Wire[] wire = { w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 }; List <Wire> wireList = new List <Wire>(); wireList.AddRange(wire); Network myNet = new Network(consList, prodList, distribList, concentList, wireList); return(myNet); }
static void Main(string[] args) { MarketSimulation france = new MarketSimulation(); WeatherSimulation belgique = new WeatherSimulation(0, 0); //NuclearPlant myprod = new NuclearPlant(1000,0,france); SolarPlant myprod = new SolarPlant(0, 1, belgique); //GasPlant myprod = new GasPlant(3,2,1); Console.WriteLine(myprod.getProduction()); Console.WriteLine(myprod.getCost()); Console.WriteLine(myprod.getEmission()); //add a producer ; GasPlant gasProd1 = new GasPlant(3, 2, france); //Try to built a network // first of all the node DistribNode distrib1 = new DistribNode(); DistribNode distrib2 = new DistribNode(); DistribNode distrib3 = new DistribNode(); ConcentNode concentrator1 = new ConcentNode(); // Next the wire and add it to a node Wire myprodWire = new Wire(myprod, distrib1, 12); //distrib1.SetPowerSupply(myprodWire); Wire gasWire = new Wire(gasProd1, distrib2, 20); //distrib2.SetPowerSupply(gasWire); Wire wire1Concen1 = new Wire(concentrator1, distrib2, 8); Wire wire2Concen1 = new Wire(concentrator1, distrib1, 8); Wire wireNodeNode1 = new Wire(distrib2, distrib3, 20); //after City paris = new City(12, "Longitude=1,Latitude=1", "Paris"); Wire parisWire = new Wire(paris, distrib3, 10); Company ferrero = new Company(12, "Longitude = 12, latitude =8", "ferrero"); Wire ferreroWire = new Wire(ferrero, distrib3, 12); Dissipaters dis1 = new Dissipaters(14, "Longitude = 12, latitude =19"); Wire disipWire = new Wire(dis1, distrib1, 4); // now we connect all the wire to the nodes distrib1.SetPowerSupply(myprodWire); Console.WriteLine("le sourant est de " + distrib1.GetActivCurrent()); distrib1.AddConnection(wire1Concen1); distrib1.AddConnection(disipWire); double [] distributionProportions = { 0.7, 0.3 }; distrib1.SetEnergyDistrib(distributionProportions); // juste pour controler si j'ai pas de problèmes List <Wire> wireliste = new List <Wire>(); wireliste = distrib1.GetConnetions(); Console.WriteLine("nombre de fils : " + wireliste.Count); Console.WriteLine("le courant est de " + wireliste[1].GetCost()); foreach (Wire fils in wireliste) { Console.WriteLine("le fils est : " + fils.GetMaxCurrent() + "Activ current = " + fils.GetActivCurrent()); } // fin Console.WriteLine("production gas line " + gasWire.GetActivCurrent()); distrib2.SetPowerSupply(gasWire); distrib2.AddConnection(wire2Concen1); double [] distributionProportions2 = { 1 }; Console.WriteLine("essais" + distrib2.GetActivCurrent()); distrib2.SetEnergyDistrib(distributionProportions2); Console.WriteLine("essais2 " + wire2Concen1.GetActivCurrent()); // fonctionne jusque ici ! concentrator1.SetConcentreWire(wireNodeNode1); concentrator1.AddConnection(wire1Concen1); concentrator1.AddConnection(wire2Concen1); distrib3.SetPowerSupply(wireNodeNode1); distrib3.AddConnection(ferreroWire); distrib3.AddConnection(parisWire); // paris.SetQuantityEnergie(2); Console.WriteLine("enregie dans le fils node node : " + wireNodeNode1.GetActivCurrent()); Console.WriteLine("le prix/kwh sur le neud distrib3 est : " + distrib3.GetCost()); Console.WriteLine("Le prix pour la ville de paris est : " + paris.GetCost(parisWire)); }
public override string ToString() { return($"M: {MetalMine.ToString()} C: {CrystalMine.ToString()} D: {DeuteriumSynthesizer.ToString()} S: {SolarPlant.ToString("")} F: {FusionReactor.ToString("")}"); }