Skip to content

Commit

Permalink
refactored example scripts into separate project
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwaibel committed Apr 28, 2021
1 parent 400ae60 commit 3e5e372
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
/CplexEnergyHubs/ECOS2018/bin
/CplexEnergyHubs/ECOS2018/obj
/CplexEnergyHubs/CISBAT21/bin
/CplexEnergyHubs/CISBAT21/obj
/CplexEnergyHubs/CISBAT21/obj
/CplexEnergyHubs/EhubExamples/bin
/CplexEnergyHubs/EhubExamples/obj
41 changes: 26 additions & 15 deletions CplexEnergyHubs/CISBAT21/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,25 @@ class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine("CISBAT 21 EnergyHubs with Demand Response to check BIPV feasibility");


// load solar potentials on building facades
// solar_Risch_2020_SP0.csv
// solar_Risch_2020_SP1.csv
// solar_Risch_2020_SP4.csv
// solar_Risch_2020_SP5.csv

// load solar surface areas. contains 193 rows plus header.
// each row corresponds to one row in solar_xxxx_20xx_SPx.csv
// get 1/4 of that area for each SP 0, 1, 4, 5
// construct an array with 193*4 entries to represent each sensor point
// SurfaceAreas.csv

// construct one matrix with solar[surface_index][time_step]



// Ehub ehub = new Ehub(heatingDemand, coolingDemand, electricityDemand, irradiance,
// solarTechSurfaceAreas, ambientTemperature, technologyParameters, clustersizePerTimestep);


// load hourly demand:
Expand All @@ -25,26 +40,22 @@ static void Main(string[] args)
// load dry bulb
// Risch_2020_DryBulb.csv

// load solar potentials on building facades
// solar_Risch_2020_SP0.csv
// solar_Risch_2020_SP1.csv
// solar_Risch_2020_SP4.csv
// solar_Risch_2020_SP5.csv

// load solar surface areas. contains 193 rows plus header.
// each row corresponds to one row in solar_xxxx_20xx_SPx.csv
// get 1/4 of that area for each SP 0, 1, 4, 5
// construct an array with 193*4 entries to represent each sensor point
// SurfaceAreas.csv

// construct one matrix with solar[surface_index][time_step]






var irradiance = new double[2][];
var dict = new Dictionary<string, double>() { };

try
{
Ehub ehub = new Ehub(new double[2] { 1, 1 }, new double[2] { 1, 1 }, new double[2] { 1, 1 }, irradiance, new double[2] { 1, 1 }, new double[2] { 1, 1 }, dict, new int[1] { 1 });
Ehub ehub = new Ehub(new double[2] { 1, 1 }, new double[2] { 1, 1 },
new double[2] { 1, 1 }, irradiance, new double[2] { 1, 1 },
new double[2] { 1, 1 }, dict, new int[1] { 1 });
}
catch(Exception e)
{
Expand Down
9 changes: 8 additions & 1 deletion CplexEnergyHubs/CplexEnergyHubs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AdamMSc2020", "AdamMSc2020\
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "EhubMisc", "EhubMisc\EhubMisc.shproj", "{CDD8E35A-FBE9-4E56-991F-12DD33803882}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CISBAT21", "CISBAT21\CISBAT21.csproj", "{90D49203-2EF1-46D2-AC55-025C3CCBB99D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CISBAT21", "CISBAT21\CISBAT21.csproj", "{90D49203-2EF1-46D2-AC55-025C3CCBB99D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EhubExamples", "EhubExamples\EhubExamples.csproj", "{049A92A0-7C08-4EB0-BF6B-93B921C7F8DD}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
EhubMisc\EhubMisc.projitems*{049a92a0-7c08-4eb0-bf6b-93b921c7f8dd}*SharedItemsImports = 5
EhubMisc\EhubMisc.projitems*{5dc0c1d9-a856-47d4-ae40-8eddac393d3e}*SharedItemsImports = 5
EhubMisc\EhubMisc.projitems*{90d49203-2ef1-46d2-ac55-025c3ccbb99d}*SharedItemsImports = 5
EhubMisc\EhubMisc.projitems*{cdd8e35a-fbe9-4e56-991f-12dd33803882}*SharedItemsImports = 13
Expand All @@ -35,6 +38,10 @@ Global
{90D49203-2EF1-46D2-AC55-025C3CCBB99D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90D49203-2EF1-46D2-AC55-025C3CCBB99D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90D49203-2EF1-46D2-AC55-025C3CCBB99D}.Release|Any CPU.Build.0 = Release|Any CPU
{049A92A0-7C08-4EB0-BF6B-93B921C7F8DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{049A92A0-7C08-4EB0-BF6B-93B921C7F8DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{049A92A0-7C08-4EB0-BF6B-93B921C7F8DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{049A92A0-7C08-4EB0-BF6B-93B921C7F8DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
19 changes: 19 additions & 0 deletions CplexEnergyHubs/EhubExamples/EhubExamples.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<Import Project="..\EhubMisc\EhubMisc.projitems" Label="Shared" />

<ItemGroup>
<Reference Include="ILOG.Concert">
<HintPath>..\..\..\..\..\..\..\Program Files\IBM\ILOG\CPLEX_Studio128\cplex\bin\x64_win64\ILOG.Concert.dll</HintPath>
</Reference>
<Reference Include="ILOG.CPLEX">
<HintPath>..\..\..\..\..\..\..\Program Files\IBM\ILOG\CPLEX_Studio128\cplex\bin\x64_win64\ILOG.CPLEX.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Text;

namespace AdamMSc2020
namespace EhubExamples
{
internal static class ExampleScripts
{
Expand Down
14 changes: 14 additions & 0 deletions CplexEnergyHubs/EhubExamples/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace EhubExamples
{
class Program
{
static void Main(string[] args)
{
ExampleScripts.ClusterLoadData();
ExampleScripts.ClusterRandomData();
ExampleScripts.SilhouetteTest();
}
}
}

0 comments on commit 3e5e372

Please sign in to comment.