-
Notifications
You must be signed in to change notification settings - Fork 13
Lifecycle of a Site
This page walks through the stages involved in uploading and running a model. Note that many of these actions (e.g. preprocessing) are triggered automatically.
When a model is uploaded to Alfalfa it is assigned a unique identifier and saved to an S3 bucket. A database entry is also created which links together the id, bucket location, and original filename it had.
In order to create a run from a model a CreateRun
job must be generated. This is usually accomplished via the REST API. There are two different CreateRun
jobs that exist and which one to call is dependent on whether the model is an OpenStudio workflow or a Modelica FMU. While these are two distinct jobs the tasks they take are similar.
The first thing either job will do is download the model, unzip it if necessary, and create a new run
database entry with information about which model it was seeded by, a unique identifier, the type of simulation, the run status, and a few other useful pieces of information. Until this point the run will not show up in the UI or the API.
Once a CreateRun
job has initialized it will start to preprocess the uploaded model. This includes confirming that the said model exists in the upload, and setting up the run directory so that everything needed to run the model is there. In the case of OpenStudio models this also includes executing all of the workflow measures, installing and linking python dependencies, and generating a point list. After this step is complete the directory is uploaded to an S3 bucket and the job is complete.
Once a model has been preprocessed is can be run by invoking the StepRun
job. This is usually accomplished via the REST API. Invoking this job requires the id of the run which completed the preprocessing as well as the time information for when to start the model and whether to advance it on an internal clock.
After invoking the job it may take some time before it starts running. This is due to the time it take for the underlying simulation engine to get initialized, connected, and warmed up. Depending on the size of the model this can take several minutes.
Once running the model can be interacted with by setting the points associated with the run
. This is usually done via the REST API. At every timestep the job will pull the new values and, after executing a timestep, push updated output values. If the job is configured to use an internal clock the model will advance on its own in accordance to the set timescale. Otherwise a message must be sent to the job telling it to advance the model.
After a model either reaches a set end time or is terminated via a command it will reupload all of the files it generated to the S3 bucket and exit.
When an error is encountered it will immediately cause the job to exit what it is doing and record the error log in the database. The status of the run will change to reflect the fact that an error has occurred and its error log will be accessible via the REST API.
- Getting Started with Model Measures Part 1: Creating Inputs and Outputs
- Getting Started with Model Measures Part 2: Creating Actuators
- Getting Started with EnergyPlus Measures Part 1: Creating Inputs and Outputs
- Getting Started with EnergyPlus Measures Part 2: Creating Actuators
- How to Configure an OpenStudio Model
- How to Configure Measures for Use with Alfalfa Ruby Gem
- How to Create Inputs and Outputs With Measures
- How to Run URBANopt Output Models in Alfalfa
- How to Migrate EnergyPlus Python Plugins
- How to Integrate Python based Electric Vehicle Models with OpenStudio Workflows
- How to Locally Test OpenStudio Models
- Required Structure of OpenStudio Workflow
- List of Automatically Generated Energyplus Points
- Alfalfa EnergyPlus Mixin Methods
- Getting Started with Uploading and Running a Model Using Python
- Getting Started with Uploading and Running a Model Using the UI
- How to Install Alfalfa Client
- How to Preprocess and Upload a Model
- How to Step Through a Simulation
- How to View Historical Data in Grafana
- How to Configure an Alias
- How to Troubleshoot Models