Creator API
The Creator API provides classes and functions for setting up simulation scenarios, including agents, markets, and grids.
Module Overview
The Creator module is responsible for:
Reading configuration files
Creating agent instances with specified properties
Setting up market structures
Defining grid topologies
Generating scenario files for the Executor
Key Classes
Creator
from hamlet.creator import Creator
creator = Creator(path="./configs", name="example_scenario")
creator.new_scenario_from_configs()
The Creator class is the main entry point for creating simulation scenarios. It reads configuration files and generates the necessary files for the Executor.
Key Methods:
new_scenario_from_configs(): Creates a new scenario from configuration filesnew_scenario_from_template(template_name): Creates a new scenario from a templatesave_scenario(): Saves the current scenario to disk
Agent Creation
The Creator module provides classes for creating different types of agents:
ConsumerAgent: For energy consumersProducerAgent: For energy producersProsumerAgent: For entities that both consume and produce energyStorageAgent: For energy storage systems
Market Creation
Markets can be configured with different clearing mechanisms:
P2PMarket: For peer-to-peer tradingPoolMarket: For centralized market clearingRetailerMarket: For traditional retailer-based markets
Grid Creation
Grid components include:
Bus: Represents a node in the gridLine: Represents a connection between busesTransformer: Represents a transformer between voltage levels
Example Usage
Creating a Simple Scenario
from hamlet.creator import Creator
# Initialize the Creator
creator = Creator(path="./configs", name="simple_scenario")
# Create a new scenario from configuration files
creator.new_scenario_from_configs()
Customizing Agent Properties
The Excel file agents.xlsx contains all the information about the agents once they are created.
It is intended to be used to fine-tune the agents to your needs without changing anything else.
This is especially useful if you want to compare scenarios as the generatino from the config files
occurs probabilistically and therefore changes all agents.
Extending the Creator
Users can extend the Creator functionality by:
Creating custom agent types
Implementing new market mechanisms
Defining specialized grid components
For more detailed information on specific classes and methods, refer to the API reference documentation.