Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
scrollbar

h2. Exercise outline

We want to run the FM model and set its time parameters.

h2. Run a FM model (and set its time parameters)

\\
Add the following import statement to the region {color:darkgreen}Import libs{color}:

{code:language=python}
# .NET lib
from System import TimeSpan

# DeltaShell libs
from DelftTools.Shell.Core.Workflow import ActivityRunner
{code}

\\
And add this code to the end of the script :
{code:language=python}
#region Run model (this takes some time +- 0.5 min)

fmModel.TimeStep = TimeSpan.FromMinutes(1) # time step 1 min
fmModel.StopTime = fmModel.StartTime.AddHours(1) # calculate 1 hour

ActivityRunner.RunActivity(fmModel)

#endregion
{code}
\\
\\