Commit 083691bb authored by Gerrit Erichsen's avatar Gerrit Erichsen
Browse files

Fixed threading issue by creating copy constructors

Fixed efficiency field issues:
   - wrongly read
   - missing some returns
   - added capping (as it was needed by storage)
Fixed some other issues along the way
parent 49cab3a8
#include "Biomass.h"
Biomass::Biomass(const SimulationPreferences * preferences) :
m_preferences(preferences),
m_fullLoadHours(0.)
m_fullLoadHours(0.),
m_preferences(preferences)
{
}
Biomass::Biomass(const Biomass * rhs, const SimulationPreferences * preferences) :
m_fullLoadHours(0.),
m_preferences(preferences)
{
m_name = rhs->m_name;
m_nominalPower = rhs->m_nominalPower;
m_specificInvestCost = rhs->m_specificInvestCost;
m_specificFixedOperationalCost = rhs->m_specificFixedOperationalCost;
m_specificOperationalCost = rhs->m_specificOperationalCost;
m_lifeTime = rhs->m_lifeTime;
}
double Biomass::getPowerAtTimeStep(int step) const
{
//simple getter
......@@ -17,9 +29,9 @@ double Biomass::getTotalPowerFed() const
{
//calculated on demand; TODO: think about extra value, that saves this information
double total = 0.;
for (int i = 0; i < m_load.size(); i++)
for (const double & load : m_load)
{
total += m_load[i] * m_preferences->getStepTime();
total += load * m_preferences->getStepTime();
}
return total;
}
......@@ -28,9 +40,9 @@ double Biomass::getTotalHeatFed() const
{
//calculated on demand; TODO: think about extra value, that saves this information
double total = 0.;
for (int i = 0; i < m_heatLoad.size(); i++)
for (const double & load : m_heatLoad)
{
total += m_heatLoad[i] * m_preferences->getStepTime();
total += load * m_preferences->getStepTime();
}
return total;
}
......@@ -39,9 +51,9 @@ double Biomass::getTotalFuelUsage() const
{
//calculated on demand; TODO: think about extra value, that saves this information
double total = 0.;
for (int i = 0; i < m_fuelUsage.size(); i++)
for (const double & usage : m_fuelUsage)
{
total += m_fuelUsage[i] * m_preferences->getStepTime();
total += usage * m_preferences->getStepTime();
}
return total;
}
......@@ -50,9 +62,9 @@ double Biomass::getTotalFuelUsageStart() const
{
//calculated on demand; TODO: think about extra value, that saves this information
double total = 0.;
for (int i = 0; i < m_fuelUsageStart.size(); i++)
for (const double & usage : m_fuelUsageStart)
{
total += m_fuelUsageStart[i] * m_preferences->getStepTime();
total += usage * m_preferences->getStepTime();
}
return total;
}
......@@ -61,9 +73,9 @@ double Biomass::getTotalPowerUsageStart() const
{
//calculated on demand; TODO: think about extra value, that saves this information
double total = 0.;
for (int i = 0; i < m_powerUsageStart.size(); i++)
for (const double & usage : m_powerUsageStart)
{
total += m_powerUsageStart[i] * m_preferences->getStepTime();
total += usage * m_preferences->getStepTime();
}
return total;
}
......@@ -72,9 +84,9 @@ double Biomass::getTotalCO2Seperated() const
{
//calculated on demand; TODO: think about extra value, that saves this information
double total = 0.;
for (int i = 0; i < m_co2Seperated.size(); i++)
for (const double & co2 : m_co2Seperated)
{
total += m_co2Seperated[i] * m_preferences->getStepTime();
total += co2 * m_preferences->getStepTime();
}
return total;
}
......
......@@ -29,6 +29,8 @@ class Biomass
{
public:
Biomass(const SimulationPreferences * preferences);
Biomass(const Biomass * rhs,
const SimulationPreferences * preferences);
//get-functions
string getName() const {return m_name;}
......
......@@ -20,7 +20,7 @@ CSP::CSP(string name, double nominalPower, double nominalReferencePower,
double stowWindSpeed,
double relativePowerNeededForStartupReceiver,
double grossToNettoPowerFactor,
double maxTimeToConsiderForHeating):
double maxTimeToConsiderForHeating) :
m_name(name),
m_nominalPower(nominalPower),
m_nominalReferencePower(nominalReferencePower),
......@@ -61,6 +61,34 @@ CSP::CSP(string name, double nominalPower, double nominalReferencePower,
m_storageLevel.assign(m_preferences->getNumberOfTimeSteps(), 0.);
}
CSP::CSP(const CSP * rhs,
const Location * location,
const SimulationPreferences * preferences) :
m_name(rhs->m_name),
m_nominalPower(rhs->m_nominalPower),
m_nominalReferencePower(rhs->m_nominalReferencePower),
m_referenceMirrorArea(rhs->m_referenceMirrorArea),
m_referenceReceiverPower(rhs->m_referenceReceiverPower),
m_receiverStartUpEnergy(rhs->m_receiverStartUpEnergy),
m_storageCapacity(rhs->m_storageCapacity),
m_storageLossFactor(rhs->m_storageLossFactor),
m_efficiencyCurveSolarField(rhs->m_efficiencyCurveSolarField),
m_efficiencyCurveReceiver(rhs->m_efficiencyCurveReceiver),
m_efficiencyCurvePowerBlock(rhs->m_efficiencyCurvePowerBlock),
m_stowWindSpeed(rhs->m_stowWindSpeed),
m_nStepsWarmingUp(rhs->m_nStepsWarmingUp),
m_specificInvestCostPower(rhs->m_specificInvestCostPower), // Specific cost of plant in €/MW
m_specificInvestCostCapacity(rhs->m_specificInvestCostCapacity),
m_specificFixedOperationalCost(rhs->m_specificFixedOperationalCost), // Specific cost of O&M as usually fix part in relation to invest cost in %
m_specificOperationalCost(rhs->m_specificOperationalCost),
m_lifeTime(rhs->m_lifeTime),
m_location(location),
m_preferences(preferences)
{
m_load.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_storageLevel.assign(m_preferences->getNumberOfTimeSteps(), 0.);
}
string CSP::getName() const
{
//simple getter
......@@ -117,6 +145,11 @@ double CSP::getTotalOperationalCost() const
return this->getFixedOperationalCost() + this->getVariableOperationalCost();
}
const Location * CSP::getLocationPtr() const
{
return m_location;
}
double CSP::getPower(size_t timeStep, double currentResidual)
{
double powerToGrid = 0.; //in MW
......
......@@ -64,6 +64,9 @@ public:
double relativePowerNeededForStartupReceiver = -1.,
double grossToNettoPowerFactor = 0.9,
double maxTimeToConsiderForHeating = 2.);
CSP(const CSP * rhs,
const Location * location,
const SimulationPreferences * preferences);
//get Funktionen
string getName() const;
......@@ -75,6 +78,7 @@ public:
double getFixedOperationalCost() const;
double getVariableOperationalCost() const;
double getTotalOperationalCost() const;
const Location * getLocationPtr() const;
//CSP
double getPower(size_t timeStep, double currentResidual);
......
......@@ -37,6 +37,7 @@ class CHARLALGORITHMSHARED_EXPORT CharLAlgorithm
public:
CharLAlgorithm();
CharLAlgorithm(const CharLAlgorithm & rhs);
virtual ~CharLAlgorithm();
//set-functions
......@@ -198,33 +199,33 @@ private:
int m_optimisationLoopCounter; //tz - counter for current optimization loop in rolling horizon
int m_optimisationLoopTotal; //tz - total number of optimization loops in rolling horizon
int probe;
int m_probe;
//dv
//for power flow
vector<double> storageDemand;
vector<double> powerSupply;
vector<double> voltage;
vector<double> m_storageDemand; //js
vector<double> m_powerSupply; //js
vector<double> m_voltage; //js
//first iteration step
vector<string> conventionalConfiguration;
vector<double> conventionalPowerConfiguration;
vector<double> specificCo2Emission;
vector<string> m_conventionalConfiguration; //js
vector<double> m_conventionalPowerConfiguration; //js
vector<double> m_specificCo2Emission; //js
vector<double> maximumPowerSupplyAtNode;
vector<double> m_maximumPowerSupplyAtNode; //js
//vector<double> storageSpecificCo2Emission;
//determinate scenario
double sumOfVolatiles;
double sumOfStoragePower;
double sumOfInstalledStorage;
double sumOfFreeStorage;
double sumOfConventional;
double sumOfDemand;
double sumOfReactiveDemand; //dv
double tolerance;
string szenario;
double m_sumOfVolatiles; //js
double m_sumOfStoragePower; //js
double m_sumOfInstalledStorage; //js
double m_sumOfFreeStorage; //js
double m_sumOfConventional; //js
double m_sumOfDemand; //js
double m_sumOfReactiveDemand; //dv
double m_tolerance; //js
string m_szenario; //js
......@@ -233,8 +234,8 @@ private:
//////////////////////////
/// network information
/////////////////////////
vector<Node *> m_nodes; // all networks, that hold their own plant configurations, data and stuff
Grid * m_grid; // how the networks work together
vector<Node *> m_nodes; //!< all networks, that hold their own plant configurations, data and stuff
Grid * m_grid; //!< how the networks work together
};
#endif // CHARLALGORITHM_H
......@@ -57,6 +57,59 @@ Conventional::Conventional(const SimulationPreferences * preferences) :
m_forecastLoad.assign(nSteps, 0.);
}
Conventional::Conventional(const Conventional * rhs, const SimulationPreferences * preferences) :
m_name(rhs->m_name),
m_power(rhs->m_power),
m_powerGradient(rhs->m_powerGradient),
m_specificCO2eqEmissions(rhs->m_specificCO2eqEmissions),
m_specificCO2actEmissions(rhs->m_specificCO2actEmissions),
m_efficiencyCurve(rhs->m_efficiencyCurve),
m_startUpTimeCold(rhs->m_startUpTimeCold),
m_startUpTimeWarm(rhs->m_startUpTimeWarm),
m_startUpTimeHot(rhs->m_startUpTimeHot),
m_minDowntime(rhs->m_minDowntime),
m_minUptime(rhs->m_minUptime),
m_coolDownTimeToWarm(rhs->m_coolDownTimeToWarm),
m_coolDownTimeToCold(rhs->m_coolDownTimeToCold),
m_lifeTime(rhs->m_lifeTime),
m_fuelType(rhs->m_fuelType),
m_temperatureCoefficient(rhs->m_temperatureCoefficient),
m_emissionHotStart(rhs->m_emissionHotStart),
m_emissionWarmStart(rhs->m_emissionWarmStart),
m_emissionColdStart(rhs->m_emissionColdStart),
m_costHotStart(rhs->m_costHotStart),
m_costWarmStart(rhs->m_costWarmStart),
m_costColdStart(rhs->m_costColdStart),
m_specificFuelCost(rhs->m_specificFuelCost),
m_specificInvestCost(rhs->m_specificInvestCost),
m_specificFixedOperationalCost(rhs->m_specificFixedOperationalCost),
m_specificOperationalCost(rhs->m_specificOperationalCost),
m_efficiencyParameterA(rhs->m_efficiencyParameterA),
m_efficiencyParameterB(rhs->m_efficiencyParameterB),
m_lastTimeOfPower(rhs->m_lastTimeOfPower),
m_preferences(preferences)
{
m_minimumLoad = m_efficiencyCurve.front().first * m_power;
m_maximumLoad = m_efficiencyCurve.back().first * m_power;
size_t nSteps = static_cast<size_t>(m_preferences->getNumberOfTimeSteps());
m_load.assign(nSteps, 0.);
m_status.assign(nSteps, 0.); //tc - status vector inititalisation
m_costStartup.assign(nSteps, 0.); //tc - vector inititalisation - output
m_heatLoad.assign(nSteps, 0.);
m_fuelUsage.assign(nSteps, 0.);
m_fuelUsageStart.assign(nSteps, 0.);
m_powerUsageStart.assign(nSteps, 0.);
m_co2emission.assign(nSteps, 0.);
m_co2emssionsStart.assign(nSteps, 0.);
m_co2Seperated.assign(nSteps, 0.);
m_co2emissionCost.assign(nSteps, 0.); //tc - output
m_fuelUsageCost.assign(nSteps, 0.); //tc - output
m_operationalCost.assign(nSteps, 0.); //tc - output
//tz - initialisation of forecast results
m_forecastLoad.assign(nSteps, 0.);
}
Conventional::Conventional(string name, double power, double gradient, double co2, double actualCo2, vector<pair<double, double> > efficiencyCurve,
double timeCold, double timeWarm, double timeHot, double minDownTime, double minUpTime, double fuelCost, double investCost, double fixedOM_Cost,
double specOM_Cost, double costHotStart, double costWarmStart, double costColdStart, double emissionsHotStart, double emissionsWarmStart, double emissionsColdStart,
......
......@@ -31,6 +31,8 @@ class CHARLALGORITHMSHARED_EXPORT Conventional
{
public:
Conventional(const SimulationPreferences * preferences);
Conventional(const Conventional * rhs,
const SimulationPreferences * preferences);
Conventional(string name, double power, double gradient, double co2, double actualCo2, vector<pair<double,double>> efficiencyCurve,
double timeCold, double timeWarm, double timeHot, double minDownTime, double minUpTime, double fuelCost, double investCost, double fixedOM_Cost, double specOM_Cost,
double costHotStart, double costWarmStart, double costColdStart, double emissionsHotStart, double emissionsWarmStart, double emissionsColdStart,
......
......@@ -169,16 +169,17 @@ double EfficiencyField::getEfficiency(double x, double y) const
else
{
//first case within major else: y1 matches y -> interpolate along x-Axis
if (isCloseEnoughToEqual(y, m_yAxis[indexY1]))
if (isCloseEnoughToEqual(y, m_yAxis[indexY1])
|| indexY1 == indexY2)
{
interpolateValuesLinear(x, m_xAxis[indexX1], m_xAxis[indexX2],
m_values[indexX1][indexY1], m_values[indexX2][indexY1]);
return interpolateValuesLinear(x, m_xAxis[indexX1], m_xAxis[indexX2],
m_values[indexX1][indexY1], m_values[indexX2][indexY1]);
}
//second case within major else: y2 matches y -> interpolate along x-Axis
else if (isCloseEnoughToEqual(y, m_yAxis[indexY2]))
{
interpolateValuesLinear(x, m_xAxis[indexX1], m_xAxis[indexX2],
m_values[indexX1][indexY2], m_values[indexX2][indexY2]);
return interpolateValuesLinear(x, m_xAxis[indexX1], m_xAxis[indexX2],
m_values[indexX1][indexY2], m_values[indexX2][indexY2]);
}
//else-else case: actually interpolate 2D bilinearly
return interpolate2DValuesBilinear(x, y, m_xAxis[indexX1], m_xAxis[indexX2],
......@@ -188,6 +189,15 @@ double EfficiencyField::getEfficiency(double x, double y) const
}
}
double EfficiencyField::getEfficiencyCapped(double x, double y) const
{
if (x < m_xAxis.front()) x = m_xAxis.front();
if (x > m_xAxis.back()) x = m_xAxis.back();
if (y < m_xAxis.front()) y = m_yAxis.front();
if (y > m_xAxis.back()) y = m_yAxis.back();
return getEfficiency(x, y);
}
double EfficiencyField::getEfficiencyTopLeft() const
{
return m_values[0][0];
......
......@@ -14,7 +14,7 @@ public:
EfficiencyField();
EfficiencyField(const vector<double> & xAxis,
const vector<double> & yAxis,
const vector<vector<double> > & values);
const vector<vector<double>> & values);
bool isEmpty();
void clear();
......@@ -28,6 +28,7 @@ public:
double getMaxY() const;
vector<pair<double, double>> getFixedCurve(bool front, bool alongX);
double getEfficiency(double x, double y) const;
double getEfficiencyCapped(double x, double y) const;
double getEfficiencyTopLeft() const;
double getEfficiencyBottomRight() const;
string getFieldAsText() const;
......
......@@ -6,12 +6,16 @@
#define PI 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803
Grid::Grid(vector<vector<double>> capacities, vector<vector<double>> impedances, vector<vector<double>> inducitivity, vector<Node *> gridNetworks, const SimulationPreferences * preferences) :
Grid::Grid(vector<vector<double>> capacities,
vector<vector<double>> impedances,
vector<vector<double>> inducitivity,
vector<Node *> gridNodes,
const SimulationPreferences * preferences) :
m_realPartVoltageDefault(380000.), //relates to 380kV since power is scaled to MW
m_imaginaryPartVoltageDefault(0.),
m_preferences(preferences)
{
m_gridNodes = gridNetworks;
m_gridNodes = gridNodes;
m_impedances = impedances;
m_capacities = capacities;
m_inducitivity = inducitivity;
......@@ -39,6 +43,23 @@ Grid::Grid(vector<vector<double>> capacities, vector<vector<double>> impedances,
m_linePowerResults.assign(m_preferences->getNumberOfTimeSteps(), dummyVector);
}
Grid::Grid(const Grid * rhs, vector<Node *> gridNodes,
const SimulationPreferences * preferences) :
m_gridNodes(gridNodes),
m_impedances(rhs->m_impedances),
m_capacities(rhs->m_capacities),
m_inducitivity(rhs->m_inducitivity),
m_lineNames(rhs->m_lineNames),
m_realPartVoltageDefault(rhs->m_realPartVoltageDefault),
m_imaginaryPartVoltageDefault(rhs->m_imaginaryPartVoltageDefault),
m_preferences(preferences)
{
m_errors.assign(m_preferences->getNumberOfTimeSteps(), "");
vector<double> dummyVector;
dummyVector.assign(m_lineNames.size(), 0.);
m_linePowerResults.assign(m_preferences->getNumberOfTimeSteps(), dummyVector);
}
Grid::~Grid()
{
for (size_t i = m_lines.size() - 1; i < m_lines.size(); --i)
......
......@@ -32,13 +32,17 @@
using namespace std;
using namespace Eigen;
class Grid {
class Grid
{
public:
/********************************************************************************************************** CONSTRUCTOR */
Grid(vector<vector<double> > capacities,
vector<vector<double> > impedances,
vector<vector<double>> inducitivity,
vector< Node * > gridNetworks,
vector<Node *> gridNodes,
const SimulationPreferences * preferences);
Grid(const Grid * rhs,
vector<Node *> gridNodes,
const SimulationPreferences * preferences);
......
......@@ -34,6 +34,31 @@ Location::Location(string name, double lat , double lon, double areaSolar, doubl
{
}
Location::Location(const Location * rhs, const SimulationPreferences * preferences)
{
m_name = rhs->m_name;
m_lat = rhs->m_lat;
m_lon = rhs->m_lon;
m_areaSolar = rhs->m_areaSolar;
m_areaWind = rhs->m_areaWind;
m_dirIrrIsNormal = rhs->m_dirIrrIsNormal;
m_meridionalIsDirection = rhs->m_meridionalIsDirection;
m_powerDemand = rhs->m_powerDemand;
m_reactivePowerDemand = rhs->m_reactivePowerDemand;
m_powerDemandForecast = rhs->m_powerDemandForecast;
m_windSpeedsZonal = rhs->m_windSpeedsZonal;
m_windSpeedsMeridional = rhs->m_windSpeedsMeridional;
m_ghi_dhi = rhs->m_ghi_dhi;
m_dirIrr = rhs->m_dirIrr;
m_temperatures = rhs->m_temperatures;
m_forecastWindSpeedsZonal = rhs->m_forecastWindSpeedsZonal;
m_forecastWindSpeedsMeridional = rhs->m_forecastWindSpeedsMeridional;
m_forecastGHI_DHI = rhs->m_forecastGHI_DHI;
m_forecastDirHI = rhs->m_forecastDirHI;
m_forecastTemperature = rhs->m_forecastTemperature;
m_preferences = preferences;
}
Location::~Location()
{
// Do not delete pointers, as this might be used again. The data is only referenced to and
......
......@@ -30,6 +30,8 @@ public:
Location(string name, double lat , double lon,
double areaSolar, double areaWind,
const SimulationPreferences * preferences);
Location(const Location * rhs,
const SimulationPreferences * preferences);
virtual ~Location();
//set functions ---------------------------------------
......@@ -125,30 +127,30 @@ private:
private:
//info ------------------------------------------------
string m_name; //name of location (e.g. NUTS-3 code)
double m_lat; //latitude of location's center
double m_lon; //longitude of location's center
double m_areaSolar; //total area available to PV farms in km^2
double m_areaWind; //total area available to wind farms in km^2
bool m_dirIrrIsNormal; //if direct irridiation is either on normal or horizontal plane
bool m_meridionalIsDirection; //if meridional data is actually direction data
string m_name; //!< name of location (e.g. NUTS-3 code)
double m_lat; //!< latitude of location's center
double m_lon; //!< longitude of location's center
double m_areaSolar; //!< total area available to PV farms in km^2
double m_areaWind; //!< total area available to wind farms in km^2
bool m_dirIrrIsNormal; //!< if direct irridiation is either on normal or horizontal plane
bool m_meridionalIsDirection; //!< if meridional data is actually direction data
//demand data (may be not in use) ---------------------
const vector<float> * m_powerDemand; //data of demand curve in MW
const vector<float> * m_reactivePowerDemand; //dv - generated reactive demand in MW
const vector<vector<float>> * m_powerDemandForecast; //forecast data for "m_powerDemand"
const vector<float> * m_powerDemand; //!< data of demand curve in MW
const vector<float> * m_reactivePowerDemand; //!< dv - generated reactive demand in MW
const vector<vector<float>> * m_powerDemandForecast; //!< forecast data for "m_powerDemand"
//weather data ----------------------------------------
const vector<float> * m_windSpeedsZonal; //weather data of zonal wind speeds in m/s
const vector<float> * m_windSpeedsMeridional; //weather data of meridional wind speeds in m/s
const vector<float> * m_ghi_dhi; //weather data of either GHI or DHI (dhi if dni is also present/filled) in W/m^2
const vector<float> * m_dirIrr; //weather data of direct horizontal irridiation in W/m^2
const vector<float> * m_temperatures; //weather data of temperature in °C
const vector<vector<float>> * m_forecastWindSpeedsZonal; //forecast data for "m_windSpeeds"
const vector<vector<float>> * m_forecastWindSpeedsMeridional; //forecast data for "m_windDirections"
const vector<vector<float>> * m_forecastGHI_DHI; //forecast data for "m_ghi_dhi"
const vector<vector<float>> * m_forecastDirHI; //forecast data for "m_dni"
const vector<vector<float>> * m_forecastTemperature; //forecast data for "m_temperatures"
const vector<float> * m_windSpeedsZonal; //!< weather data of zonal wind speeds in m/s
const vector<float> * m_windSpeedsMeridional; //!< weather data of meridional wind speeds in m/s
const vector<float> * m_ghi_dhi; //!< weather data of either GHI or DHI (dhi if dni is also present/filled) in W/m^2
const vector<float> * m_dirIrr; //!< weather data of direct horizontal irridiation in W/m^2
const vector<float> * m_temperatures; //!< weather data of temperature in °C
const vector<vector<float>> * m_forecastWindSpeedsZonal; //!< forecast data for "m_windSpeeds"
const vector<vector<float>> * m_forecastWindSpeedsMeridional; //!< forecast data for "m_windDirections"
const vector<vector<float>> * m_forecastGHI_DHI; //!< forecast data for "m_ghi_dhi"
const vector<vector<float>> * m_forecastDirHI; //!< forecast data for "m_dni"
const vector<vector<float>> * m_forecastTemperature; //!< forecast data for "m_temperatures"
//preferences -----------------------------------------
const SimulationPreferences * m_preferences; //preferences
const SimulationPreferences * m_preferences; //!< preferences
};
#endif // LOCATION_H
......@@ -20,7 +20,114 @@ Node::Node(string name, const SimulationPreferences * preferences) :
m_voltageControlledGenerator(true)
{
//create new internal result
m_result = new InternalResult(name, m_preferences->getNumberOfTimeSteps(), m_preferences->getStepTime());
m_result = new InternalResult(name,
m_preferences->getNumberOfTimeSteps(),
m_preferences->getStepTime());
//pre-assign vector-values
m_connectedPower.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_connectedReactivePower.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_generatedPower.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_generatedReactivePower.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_gridDemand.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_gridReactiveDemand.assign(m_preferences->getNumberOfTimeSteps(), 0.);
m_voltage.assign(m_preferences->getNumberOfTimeSteps(), 0.);
}
Node::Node(const Node * rhs, const SimulationPreferences * preferences) :
m_name(rhs->m_name),
m_preferences(preferences),
m_windCapacityGeneric(rhs->m_windCapacityGeneric),
m_solarCapacityGeneric(rhs->m_solarCapacityGeneric),
m_installedBiomass(rhs->m_installedBiomass),
m_installedConventional(rhs->m_installedConventional),
m_installedStoragePower(rhs->m_installedStoragePower),
m_installedStorageCapacity(rhs->m_installedStorageCapacity),
m_installedWind(rhs->m_installedWind),
m_installedSolar(rhs->m_installedSolar),
m_installedCSP(rhs->m_installedCSP), //tb - CSP
m_nodeType(rhs->m_nodeType),
m_gridIndex(rhs->m_gridIndex),
m_voltageControlledGenerator(rhs->m_voltageControlledGenerator)
{
// copying locations ------------------------------------------------------
for (size_t i = 0; i < rhs->m_locations.size(); i++)
{
m_locations.push_back(new Location(rhs->m_locations[i], m_preferences));
}
// copying plants ---------------------------------------------------------
// biomass
for (const Biomass * rhsPlant : rhs->m_biomass)
{
m_biomass.push_back(new Biomass(rhsPlant, m_preferences));
}
// conventional
for (const Conventional * rhsPlant : rhs->m_conventional)
{
m_conventional.push_back(new Conventional(rhsPlant, m_preferences));
}