Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CircularGreenSimCity
CircularGreenSimCity
Compare Revisions
1b94df8ad814acece39dcbba49c28738b72eb320...12ac2ddbd7d05941868cb45136e970067ff43a71
Commits (2)
New script, with default HeatDemand
· 358ed818
Eric Duminil
authored
Apr 05, 2024
358ed818
Modifying run_simstadt structure a bit
· 12ac2ddb
Eric Duminil
authored
Apr 05, 2024
12ac2ddb
Expand all
Hide whitespace changes
Inline
Side-by-side
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/00_ImportCityGml.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.citygml.steps.ImportCityGml"
id=
"ImportCityGml0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
startStep
</string>
<void
method=
"set"
>
<object
idref=
"ImportCityGml0"
/>
<boolean>
true
</boolean>
</void>
</void>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"ImportCityGml0"
/>
<string>
01_Preprocessing.step
</string>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/01_Preprocessing.step/00_GeometricPreprocessor.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.GeometricPreprocessorStep"
id=
"GeometricPreprocessorStep0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
startStep
</string>
<void
method=
"set"
>
<object
idref=
"GeometricPreprocessorStep0"
/>
<boolean>
true
</boolean>
</void>
</void>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"GeometricPreprocessorStep0"
/>
<string>
01_GeometricEstimator.step
</string>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/01_Preprocessing.step/01_GeometricEstimator.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.GeometricEstimatorStep"
id=
"GeometricEstimatorStep0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"GeometricEstimatorStep0"
/>
<string>
02_PhysicsPreprocessor.step
</string>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/01_Preprocessing.step/02_PhysicsPreprocessor.step/GermanBuildingTypologyLibrary_IWU.xml
0 → 100644
View file @
12ac2ddb
This diff is collapsed.
Click to expand it.
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/01_Preprocessing.step/02_PhysicsPreprocessor.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.PhysicsPreprocessorStep"
id=
"PhysicsPreprocessorStep0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"PhysicsPreprocessorStep0"
/>
<string>
03_UsagePreprocessor.step
</string>
</void>
</void>
<void
property=
"libraries"
>
<void
method=
"add"
>
<object
class=
"de.hft.stuttgart.simstadt2.assessment.PhysicsXmlLib"
>
<void
property=
"path"
>
<string>
C:\Users\eric.duminil\git\simstadt2\TestRepository\Gruenbuehl.proj\01_HeatDemand.flow\01_Preprocessing.step\02_PhysicsPreprocessor.step\GermanBuildingTypologyLibrary_IWU.xml
</string>
</void>
</object>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
<void
property=
"selectedLibrary"
>
<int>
2
</int>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/01_Preprocessing.step/03_UsagePreprocessor.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.UsagePreprocessorStep"
>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/01_Preprocessing.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.Preprocessing"
id=
"Preprocessing0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.Workflow"
method=
"getField"
>
<string>
selectedStartStepPath
</string>
<void
method=
"set"
>
<object
idref=
"Preprocessing0"
/>
<string>
00_GeometricPreprocessor.step
</string>
</void>
</void>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"Preprocessing0"
/>
<string>
02_WeatherProcessor.step
</string>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/02_WeatherProcessor.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.WeatherProcessorStep"
id=
"WeatherProcessorStep0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"WeatherProcessorStep0"
/>
<string>
03_IrradianceProcessor.step
</string>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/03_IrradianceProcessor.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.IrradianceProcessorStep"
id=
"IrradianceProcessorStep0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
selectedNextStepPath
</string>
<void
method=
"set"
>
<object
idref=
"IrradianceProcessorStep0"
/>
<string>
04_MonthlyEnergyBalance.step
</string>
</void>
</void>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/04_MonthlyEnergyBalance.step/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflowsteps.MonthlyEnergyBalanceStep"
>
<void
property=
"name"
>
<string>
Base
</string>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/TemplateWorkflows/01_HeatDemand.flow/params.xml
0 → 100644
View file @
12ac2ddb
<?xml version="1.0" encoding="UTF-8"?>
<java
version=
"1.8.0_345"
class=
"java.beans.XMLDecoder"
>
<object
class=
"eu.simstadt.workflows.CityGmlWorkflow"
id=
"CityGmlWorkflow0"
>
<void
class=
"de.hftstuttgart.hierarchicworkflow.Workflow"
method=
"getField"
>
<string>
selectedStartStepPath
</string>
<void
method=
"set"
>
<object
idref=
"CityGmlWorkflow0"
/>
<string>
00_ImportCityGml.step
</string>
</void>
</void>
<void
class=
"de.hftstuttgart.hierarchicworkflow.WorkflowStep"
method=
"getField"
>
<string>
startStep
</string>
<void
method=
"set"
>
<object
idref=
"CityGmlWorkflow0"
/>
<boolean>
true
</boolean>
</void>
</void>
<void
property=
"name"
>
<string>
Gruenbuehl_HeatDemand
</string>
</void>
<void
property=
"shortName"
>
<string>
HeatDemand
</string>
</void>
<void
property=
"workflowProvider"
>
<object
class=
"de.hftstuttgart.simstadtworkflows.energy.HeatDemandAnalysisWorkflowProvider"
/>
</void>
</object>
</java>
python_scripts/run_simstadt_from_python/run_simstadt_workflow.py
View file @
12ac2ddb
...
...
@@ -64,7 +64,7 @@ SCRIPT_DIR = Path(__file__).parent
SIMSTADT_GLOB
=
'Desktop/SimStadt_0.*/'
REPO_PATH
=
SCRIPT_DIR
.
parent
.
parent
/
'simstadt'
/
'TestRepository'
REPO_PATH
=
Path
.
home
()
/
'git'
/
'simstadt'
/
'TestRepository'
PROJECT_NAME
=
'Gruenbuehl'
WORKFLOW_FOLDERS
=
[
'a.step'
,
'b.step'
]
CITYGMLS
=
[
'Gruenbuehl_LOD2_ALKIS_1010.gml'
,
'Gruenbuehl_LOD2_ALKIS_1010_2buildings.gml'
]
...
...
@@ -72,12 +72,11 @@ CITYGMLS = ['Gruenbuehl_LOD2_ALKIS_1010.gml', 'Gruenbuehl_LOD2_ALKIS_1010_2build
##############################################
PROJECT_PATH
=
REPO_PATH
/
f
'
{
PROJECT_NAME
}
.proj'
PARAMS
=
'params.xml'
# TODO: write tests
def
find_simstadt
(
simstadt_glob
)
:
def
find_simstadt
(
simstadt_glob
:
str
)
->
Path
:
try
:
found
=
next
(
Path
.
home
().
glob
(
simstadt_glob
))
logging
.
info
(
"# SimStadt found in %s
\n
"
,
found
)
...
...
@@ -86,7 +85,7 @@ def find_simstadt(simstadt_glob):
sys
.
exit
(
f
"Sorry, no SimStadt installation could be found in
{
simstadt_glob
}
"
)
def
check_paths
(
repo_path
,
workflow_path
):
def
check_paths
(
repo_path
:
Path
,
workflow_path
:
Path
):
if
not
repo_path
.
exists
():
sys
.
exit
(
f
"Sorry, no Repository could be found in
{
repo_path
}
"
)
...
...
@@ -103,6 +102,9 @@ def check_paths(repo_path, workflow_path):
def
prepare_workflow
(
workflow_path
,
citygmls
):
if
isinstance
(
citygmls
,
str
):
citygmls
=
[
citygmls
]
tree
=
et
.
parse
(
workflow_path
/
PARAMS
)
root
=
tree
.
getroot
()
...
...
@@ -173,10 +175,10 @@ def compare_written_files(repo_path, before, after):
logging
.
info
(
"
\n
"
)
def
run_workflow
(
simstadt_path
,
workflow_
folder
,
citygmls
):
workflow_path
=
PROJECT_PATH
/
workflow_folder
def
run_workflow
(
simstadt_path
:
Path
,
workflow_
path
:
Path
,
citygmls
:
list
[
str
]
):
repo_path
=
workflow_path
.
parent
.
parent
check_paths
(
REPO_PATH
,
workflow_path
)
check_paths
(
repo_path
,
workflow_path
)
name
=
prepare_workflow
(
workflow_path
,
citygmls
)
...
...
@@ -184,15 +186,16 @@ def run_workflow(simstadt_path, workflow_folder, citygmls):
run_simstadt
(
simstadt_path
,
workflow_path
,
name
)
after
=
get_all_files
(
workflow_path
)
compare_written_files
(
REPO_PATH
,
before
,
after
)
compare_written_files
(
repo_path
,
before
,
after
)
def
main
(
glob
,
workflows
,
citygmls
):
def
main
(
glob
:
str
,
repo
:
Path
,
project_name
:
str
,
workflows
:
list
[
str
],
citygmls
:
list
[
str
]
):
simstadt_path
=
find_simstadt
(
glob
)
project_path
=
repo
/
f
'
{
project_name
}
.proj'
for
workflow_folder
in
workflows
:
run_workflow
(
simstadt_path
,
workflow_folder
,
citygmls
)
run_workflow
(
simstadt_path
,
project_path
/
workflow_folder
,
citygmls
)
if
__name__
==
'__main__'
:
main
(
SIMSTADT_GLOB
,
WORKFLOW_FOLDERS
,
CITYGMLS
)
main
(
SIMSTADT_GLOB
,
REPO_PATH
,
PROJECT_NAME
,
WORKFLOW_FOLDERS
,
CITYGMLS
)
python_scripts/run_simstadt_from_python/variable_window_ratio.py
0 → 100644
View file @
12ac2ddb
from
run_simstadt_workflow
import
find_simstadt
SIMSTADT2_GLOB
=
'Desktop/SimStadt2_0.*/'
print
(
find_simstadt
(
SIMSTADT2_GLOB
))