Skip to content

Command line

It might be needed to launch SimStadt without GUI, e.g. on a headless server or to reduce memory consumption.

The corresponding class is called SimStadtCommandLineInterface.

Prerequisites

  • Java 8 needs to be installed.
  • INSEL probably needs to be installed.
  • A repository. (e.g. TestRepositoryWithCache)
  • At least one project needs to be inside the repository.
  • At least one workflow needs to be inside the project:
    • Either created with the GUI (define the parameters + Save button in the top-right corner)
    • Or copied from another repository.
    • Or created with a script, possibly from templates.

Syntax

SimStadt command line can be launched in the same way as SimStadt:

# On windows
java -d64 -classpath lib/*;workflows/* eu.simstadt.desktop.SimStadtCommandLineInterface [PATH_TO_FOLDER]
# On Linux
java -d64 -classpath lib/*:workflows/* eu.simstadt.desktop.SimStadtCommandLineInterface [PATH_TO_FOLDER]

In order to simplify the call, SimStadt.bat and SimStadt.sh scripts will launch SimStadtApp when called without argument and will launch SimStadtCommandLineInterface when called with at least one argument.

The argument should be an existing folder, containing either:

  • a repository
  • a project
  • a workflow

Repository path as argument

When called with a repository path as argument, a list of available projects will be displayed.

./SimStadt.sh ../TestRepository

or

SimStadt.bat ..\TestRepositoryWithCache

outputs:

Launching: java -d64 -classpath lib/*:workflows/* -Xms512m -Xmx2g -Djava.util.logging.config.file=logging.properties eu.simstadt.desktop.SimStadtCommandLineInterface ../TestRepository
May 21, 2019 4:26:24 PM eu.simstadt.desktop.SimStadtCommandLineInterface main
INFO: Input could be a repository.
May 21, 2019 4:26:26 PM eu.simstadt.desktop.SimStadtCommandLineInterface getRepository
INFO: Found repository: /home/my_user/Desktop/TestRepository
May 21, 2019 4:26:26 PM eu.simstadt.desktop.SimStadtCommandLineInterface listProjects
INFO: Available projects for repository '/home/my_user/Desktop/TestRepository':
  Dirk                           : /home/my_user/Desktop/TestRepository/Dirk.proj
  Ensource                       : /home/my_user/Desktop/TestRepository/Ensource.proj
  Gruenbuehl                     : /home/my_user/Desktop/TestRepository/Gruenbuehl.proj
  Ludwigsburg                    : /home/my_user/Desktop/TestRepository/Ludwigsburg.proj
  Mainz                          : /home/my_user/Desktop/TestRepository/Mainz.proj
  Muenchen                       : /home/my_user/Desktop/TestRepository/Muenchen.proj
  NewYork                        : /home/my_user/Desktop/TestRepository/NewYork.proj
  Rotterdam                      : /home/my_user/Desktop/TestRepository/Rotterdam.proj
  ShadowExample                  : /home/my_user/Desktop/TestRepository/ShadowExample.proj
  SimpleBuilding                 : /home/my_user/Desktop/TestRepository/SimpleBuilding.proj
  SimpleBuildingWithEnergyADE    : /home/my_user/Desktop/TestRepository/SimpleBuildingWithEnergyADE.proj
  Singapore                      : /home/my_user/Desktop/TestRepository/Singapore.proj
  Stoeckach                      : /home/my_user/Desktop/TestRepository/Stoeckach.proj
  Stuttgart                      : /home/my_user/Desktop/TestRepository/Stuttgart.proj
  Test                           : /home/my_user/Desktop/TestRepository/Test.proj
  TestDIN18599                   : /home/my_user/Desktop/TestRepository/TestDIN18599.proj
  TestLandkreis                  : /home/my_user/Desktop/TestRepository/TestLandkreis.proj
  TwoSimpleBuildings             : /home/my_user/Desktop/TestRepository/TwoSimpleBuildings.proj
  Ulm_Wiblingen                  : /home/my_user/Desktop/TestRepository/Ulm_Wiblingen.proj
  Walheim                        : /home/my_user/Desktop/TestRepository/Walheim.proj
  WeBest                         : /home/my_user/Desktop/TestRepository/WeBest.proj
  Wuestenrot                     : /home/my_user/Desktop/TestRepository/Wuestenrot.proj

Project path as argument

When called with a project path as argument, a list of available workflows with be displayed.

./SimStadt.sh ../TestRepository/Gruenbuehl.proj

or

SimStadt.bat ..\TestRepositoryWithCache\NYC.proj

outputs:

Launching: java -d64 -classpath lib/*:workflows/* -Xms512m -Xmx2g -Djava.util.logging.config.file=logging.properties eu.simstadt.desktop.SimStadtCommandLineInterface ../TestRepository/Gruenbuehl.proj
May 21, 2019 4:29:08 PM eu.simstadt.desktop.SimStadtCommandLineInterface main
INFO: Input looks like a Project.
May 21, 2019 4:29:10 PM eu.simstadt.desktop.SimStadtCommandLineInterface getRepository
INFO: Found repository: /home/my_user/Desktop/TestRepository
May 21, 2019 4:29:10 PM eu.simstadt.desktop.SimStadtCommandLineInterface getProject
INFO: Found project: Gruenbuehl
May 21, 2019 4:29:10 PM eu.simstadt.desktop.SimStadtCommandLineInterface listWorkflows
INFO: Available workflows for project 'Gruenbuehl':
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/a.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/b.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/c.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/d.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/f.step - Gruenbuehl_LOD2_ALKIS_1010_EnvironmentalAnalysis (CityGmlWorkflow / EnvironmentalAnalysis)

Workflow path as argument

When called with a workflow path as argument, the workflow will be launched and the result files will be listed.

./SimStadt.sh ../TestRepository/Gruenbuehl.proj/e.step

or

SimStadt.bat ..\TestRepositoryWithCache\NYC.proj\b.step

outputs:

Launching: java -d64 -classpath lib/*:workflows/* -Xms512m -Xmx2g -Djava.util.logging.config.file=logging.properties eu.simstadt.desktop.SimStadtCommandLineInterface ../TestRepository/Gruenbuehl.proj/e.step
May 21, 2019 4:35:41 PM eu.simstadt.desktop.SimStadtCommandLineInterface main
INFO: Input looks like a Workflow.
May 21, 2019 4:35:44 PM eu.simstadt.desktop.SimStadtCommandLineInterface getRepository
INFO: Found repository: /home/my_user/Desktop/TestRepository
May 21, 2019 4:35:44 PM eu.simstadt.desktop.SimStadtCommandLineInterface getProject
INFO: Found project: Gruenbuehl
May 21, 2019 4:35:44 PM eu.simstadt.desktop.SimStadtCommandLineInterface getWorkflow
INFO: Found workflow: CityGmlWorkflow [name=Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis, pathToMe=e.step, selectedNext=Optional.empty, subWorkflowPath=a.step]
May 21, 2019 4:35:44 PM eu.simstadt.desktop.SimStadtCommandLineInterface launchWorkflow
INFO: Lauching: /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
May 21, 2019 4:35:51 PM de.hft.stuttgart.citydoctor.parsers.CityGMLParserImpl parse
INFO: Found CITY_MODEL version 2.0.0
May 21, 2019 4:35:51 PM de.hft.stuttgart.citydoctor.writer.CityDoctorModel loadWithEnergyADE
INFO: The city model contains 176 building features
May 21, 2019 4:35:54 PM eu.simstadt.datamodel.SimStadtModel <init>
INFO: Number of imported building units in model Gruenbuehl_LOD2_ALKIS_1010.gml: 0.
May 21, 2019 4:35:54 PM eu.simstadt.datamodel.SimStadtModel <init>
INFO: Number of imported building in model Gruenbuehl_LOD2_ALKIS_1010.gml: 176.
May 21, 2019 4:36:00 PM de.hftstuttgart.hierarchicworkflow.RepositoryNode isCacheUpToDate
INFO: Using available cache version (7) for /home/my_user/Desktop/TestRepository/.cache
May 21, 2019 4:36:00 PM eu.simstadt.weather.data.WeatherStation findNearest
INFO: Nearest weather station in INSELDB is 'Stuttgart / Germany' (12.4 km).
May 21, 2019 4:36:00 PM de.hftstuttgart.hierarchicworkflow.RepositoryNode isCacheUpToDate
INFO: Using available cache version (7) for /home/my_user/Desktop/TestRepository/.cache
May 21, 2019 4:36:00 PM eu.simstadt.weather.data.WeatherStation findNearest
INFO: Nearest weather station in INSELDB is 'Stuttgart / Germany' (12.4 km).
May 21, 2019 4:36:00 PM eu.simstadt.weather.processing.WeatherProcessing computeTsky
INFO: Tsky calculated with Swinbank Fuentes sky model
May 21, 2019 4:36:00 PM de.hftstuttgart.hierarchicworkflow.RepositoryNode isCacheUpToDate
INFO: Using available cache version (7) for /home/my_user/Desktop/TestRepository/.cache
May 21, 2019 4:36:00 PM eu.simstadt.irradiance.InselSkyModel isRadiationTableComplete
INFO: /home/my_user/Desktop/TestRepository/.cache/irradiances/tilted_irradiances_inseldb_Stuttgart_Hay__5_5.prn seems to be complete.
May 21, 2019 4:36:01 PM eu.simstadt.irradiance.InselSkyModel calculate
INFO: Azimuth Resolution = 5 / Tilt Resolution = 5 / Number of Orientation Categories = 1533 / Monthly Horizontal irradiances = [40, 70, 114, 168, 210, 227, 230, 186, 153, 95, 46, 32]
May 21, 2019 4:36:01 PM eu.simstadt.weather.processing.InselWeatherProcessing writeInselHourlyWeatherFile
INFO: Hourly weather file has been written to /tmp/hourly_gh_gdh_ta_inseldb_Stuttgart2683982879348766406.prn
May 21, 2019 4:36:01 PM eu.simstadt.simulation_plugins.insel.InselModelBuilder generateInselModel
INFO: INSEL model file /tmp/hourly_total_photovoltaic_production2205148307720236186.insel generated from sun.net.www.protocol.jar.JarURLConnection$JarURLInputStream@6c479748.
May 21, 2019 4:36:01 PM eu.simstadt.simulation_plugins.SimulationUtils lookForProgramInPath
INFO: insel has been found at : /usr/bin/insel
May 21, 2019 4:36:26 PM eu.simstadt.photovoltaic.HourlyPhotovoltaicProfileGenerator saveHourlyValuesAndCalculateTotal
INFO: Hourly PV Potential AC power written to /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step/a.step/a.step/a.step/a.step/a.step/a.step/Gruenbuehl_LOD2_ALKIS_1010_inseldb_Hay_pv_hourly_production.csv.
May 21, 2019 4:36:26 PM eu.simstadt.workflowsteps.PhotovoltaicPotential compareBothYields
INFO: Potential yield from yearly analysis : 897.9MWh/a. Hourly analysis : 888.9MWh/a. Difference : -1.0%
May 21, 2019 4:36:26 PM eu.simstadt.workflowsteps.PhotovoltaicPotential calculatePVPotentialAndExportResultsToCSV
INFO: PV Potential analysis result file written to /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step/a.step/a.step/a.step/a.step/a.step/a.step/Gruenbuehl_LOD2_ALKIS_1010_inseldb_Hay_pv_potential.csv.
May 21, 2019 4:36:26 PM de.hftstuttgart.hierarchicworkflow.TopLevelWorkflow initAndRun
INFO: Computation time was 0:00:42
May 21, 2019 4:36:26 PM eu.simstadt.desktop.SimStadtCommandLineInterface launchWorkflow
INFO: Finished: /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step - Gruenbuehl_LOD2_ALKIS_1010_PhotovoltaicPotentialAnalysis (CityGmlWorkflow / PhotovoltaicPotentialAnalysis)
May 21, 2019 4:36:26 PM eu.simstadt.desktop.SimStadtCommandLineInterface listFilesInSubfolders
INFO: These files have been written in '/home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step':
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step/a.step/a.step/a.step/a.step/a.step/a.step/Gruenbuehl_LOD2_ALKIS_1010_inseldb_Hay_pv_hourly_production.csv
  /home/my_user/Desktop/TestRepository/Gruenbuehl.proj/e.step/a.step/a.step/a.step/a.step/a.step/a.step/Gruenbuehl_LOD2_ALKIS_1010_inseldb_Hay_pv_potential.csv