Skip to content

Demand Allocation: Add leakage as user defined demand #1

@lbutler

Description

@lbutler

Currently, the script just allocates the customer points, to add leakage you have a separate user-defined leakage demand that matches the number of allocated properties.

To do this you need to go to each node that has a property attached and add a row to the demand_by_category WSStructure.

Adding to a WSStructure isn't documented but you do it by increasing the size of the array as per the below code.

Can add to demand allocation script and a separate script talking about updating values.

ro = net.row_object("_nodes","1")

net.transaction_begin 

row_count = ro.demand_by_category.size
ro.demand_by_category.size = row_count +1
new_struct =  ro.demand_by_category[row_count]

new_struct.category_id = "Leakage"
new_struct.spec_consumption = 150
new_struct.no_of_properties = 3

ro.demand_by_category.write
ro.write

net.transaction_commit 

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions