1 Allocation
Allocation()
Defines the allocation optimization algorithm options.
1.1 Attributes
Name | Type | Description |
---|---|---|
timestep | float | The simulated time in seconds between successive allocation calls (Optional, defaults to 86400) |
use_allocation | bool | Whether the allocation algorithm should be active. If not, UserDemand nodes attempt to abstract their full demand (Optional, defaults to False) |
1.2 Methods
Name | Description |
---|---|
diff | Compare two instances of a BaseModel. |
model_dump |
1.2.1 diff
=False) Allocation.diff(other, ignore_meta
Compare two instances of a BaseModel.
** Warning: This method is experimental and is likely to change. **
If they are equal, return None. Otherwise, return a nested dictionary with the differences. When the differences are not a DataFrame (like the toml config), the dict has self and other as key. For DataFrames we return a dict with diff as key, and a datacompy Comparison object.
When ignore_meta is set to True, the meta_* columns in the DataFrames are ignored. Note that in that case the key will still be returned and the value will be None.
1.2.1.1 Examples
>>> nbasic == basic
False
>>> x = nbasic.diff(basic)
'basin': {'node': {'diff': <datacompy.core.Compare object at 0x16e5a45c0>},
{'static': {'diff': <datacompy.core.Compare object at 0x16eb90080>}},
'solver': {'saveat': {'other': 86400.0, 'self': 0.0}}}
>>> x["basin"]["static"]["diff"].report()
DataComPy Comparison--------------------
...
1.2.2 model_dump
**kwargs) Allocation.model_dump(