simulation
EnSimulation
¶
Bases: BaseModel
Represents the simulation entity in the application.
The EnSimulation
class models a simulation instance with its various
properties, including token, status, start and end dates, and
association to a specific scenario. It provides a structured
representation of simulation for storing and retrieving purposes.
Attributes:
Name | Type | Description |
---|---|---|
sim_token |
str
|
Unique token identifying the simulation. |
status |
str
|
Current status of the simulation, e.g., started, completed. |
start_date |
datetime
|
Date and time when the simulation was started. |
end_date |
datetime | None
|
Date and time when the simulation was ended (optional). |
scenario_id |
int
|
Identifier of the related scenario in the database. |
Source code in backend/app/simulation/model.py
EnSimulationDB
¶
Bases: SQLModel
Representation of a simulation entry in the database.
This class defines the data structure and table mapping for simulation entries in the database. It includes fields for basic simulation attributes such as its unique identifier, status, dates, and related scenario. This model is used to manage and interact with the simulation data persisted in the database.
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
Unique identifier for the simulation. |
sim_token |
str
|
Token associated with the simulation, used for identification or access. |
status |
str
|
Current status of the simulation. Default is |
start_date |
datetime
|
Date and time when the simulation started. |
end_date |
datetime | None
|
Date and time when the simulation ended, if available. |
scenario_id |
int
|
Identifier of the related scenario. Links the simulation record to a scenario in the database. |
Source code in backend/app/simulation/model.py
EnSimulationUpdate
¶
Bases: SQLModel
Represents an energy simulation update model used to track the status and completion date of a simulation.
This class models the data structure for storing information about an energy simulation's current status and its potential end date. It inherits from SQLModel to enable database interactions and data serialization.
Attributes:
Name | Type | Description |
---|---|---|
status |
str
|
Indicates the current status of the energy simulation. |
end_date |
datetime | None
|
Represents the simulation's end date if available. |