formatting
This commit is contained in:
@ -14,16 +14,19 @@ namespace Building
|
||||
class Cost;
|
||||
}
|
||||
|
||||
class Factory {
|
||||
public:
|
||||
std::unique_ptr<Building::Cost> static create_test_cost() {
|
||||
class Factory
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<Building::Cost> static create_test_cost()
|
||||
{
|
||||
auto cost = std::make_unique<Building::Cost>();
|
||||
cost->set_special_rate_consumption(0.15f);
|
||||
cost->set_special_rate_generation(0.10f);
|
||||
return cost;
|
||||
}
|
||||
|
||||
std::unique_ptr<Building::Simulation_Values> static create_test_simulation_values() {
|
||||
std::unique_ptr<Building::Simulation_Values> static create_test_simulation_values()
|
||||
{
|
||||
auto values = std::make_unique<Building::Simulation_Values>();
|
||||
|
||||
auto communityCoverage = std::vector<std::unique_ptr<float>>();
|
||||
@ -31,7 +34,9 @@ class Factory {
|
||||
auto neededCon = std::vector<std::unique_ptr<float>>();
|
||||
auto neededGen = std::vector<std::unique_ptr<float>>();
|
||||
|
||||
for (int i = 0; i < 5; i++) { // Populate with test values
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
// Populate with test values
|
||||
communityCoverage.push_back(std::make_unique<float>(i * 10.0f));
|
||||
ownUsage.push_back(std::make_unique<float>(i * 5.0f));
|
||||
neededCon.push_back(std::make_unique<float>(i * 3.0f));
|
||||
@ -46,7 +51,8 @@ class Factory {
|
||||
return values;
|
||||
}
|
||||
|
||||
std::unique_ptr<Building::Metadata> static create_test_metadata() {
|
||||
std::unique_ptr<Building::Metadata> static create_test_metadata()
|
||||
{
|
||||
auto metadata = std::make_unique<Building::Metadata>();
|
||||
metadata->set_name("Test Building");
|
||||
metadata->set_annual_consumption(12000.0f);
|
||||
@ -59,7 +65,9 @@ class Factory {
|
||||
auto consumptionProfile = std::vector<std::unique_ptr<float>>();
|
||||
auto generationProfile = std::vector<std::unique_ptr<float>>();
|
||||
|
||||
for (int i = 0; i < 5; i++) { // Populate with test values
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
// Populate with test values
|
||||
consumptionProfile.push_back(std::make_unique<float>(i * 100.0f));
|
||||
generationProfile.push_back(std::make_unique<float>(i * 50.0f));
|
||||
}
|
||||
@ -70,24 +78,30 @@ class Factory {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
std::unique_ptr<Building::Base> static create_test_building() {
|
||||
std::unique_ptr<Building::Base> static create_test_building()
|
||||
{
|
||||
auto building = std::make_unique<Building::Base>();
|
||||
|
||||
building->set_cost( create_test_cost());
|
||||
building->set_cost(create_test_cost());
|
||||
building->set_values(create_test_simulation_values());
|
||||
building->set_metadata(create_test_metadata());
|
||||
|
||||
return building;
|
||||
}
|
||||
Energy_Tariff static create_test_energy_tariff() {
|
||||
|
||||
Energy_Tariff static create_test_energy_tariff()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
std::unique_ptr<Community> static create_test_community() {
|
||||
|
||||
std::unique_ptr<Community> static create_test_community()
|
||||
{
|
||||
auto community = std::make_unique<Community>();
|
||||
community->set_name("Test Community");
|
||||
|
||||
std::vector<std::unique_ptr<Building::Base>> buildings;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
buildings.push_back(create_test_building());
|
||||
}
|
||||
|
||||
@ -96,9 +110,7 @@ class Factory {
|
||||
|
||||
return community;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //FACTORY_H
|
||||
|
||||
Reference in New Issue
Block a user