Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Zero_engine.alpx
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,11 @@
<Id>1755154772688</Id>
<Name><![CDATA[ChargingManagement]]></Name>
</Folder>
<Folder>
<Id>1756210851750</Id>
<Name><![CDATA[AggregatorAlgorithms]]></Name>
<ParentId>1752677826356</ParentId>
</Folder>
</Folders>
<ActiveObjectClasses/>
<DifferentialEquationsMethod>EULER</DifferentialEquationsMethod>
Expand Down Expand Up @@ -1665,6 +1670,40 @@
<Name><![CDATA[J_ChargingManagementLocalBalancing]]></Name>
<Folder>1755154772688</Folder>
</JavaClass>
<JavaClass>
<Id>1756208281968</Id>
<Name><![CDATA[J_BatteryManagementExternalSetpoint]]></Name>
<Folder>1752677826356</Folder>
</JavaClass>
<JavaClass>
<Id>1756210474555</Id>
<Name><![CDATA[I_InterfaceAggragotrBatteryManagement]]></Name>
</JavaClass>
<JavaClass>
<Id>1756210846035</Id>
<Name><![CDATA[I_AggregatorBatteryManagement]]></Name>
<Folder>1756210851750</Folder>
</JavaClass>
<JavaClass>
<Id>1756211095187</Id>
<Name><![CDATA[J_AggregatorBatteryManagementOff]]></Name>
<Folder>1756210851750</Folder>
</JavaClass>
<JavaClass>
<Id>1756212442478</Id>
<Name><![CDATA[J_AggregatorBatteryManagementCollectiveSelfConsumption_batterySize]]></Name>
<Folder>1756210851750</Folder>
</JavaClass>
<JavaClass>
<Id>1756213000574</Id>
<Name><![CDATA[J_AggregatorBatteryManagementCollectiveSelfConsumption_exportRate]]></Name>
<Folder>1756210851750</Folder>
</JavaClass>
<JavaClass>
<Id>1756213864971</Id>
<Name><![CDATA[J_AggregatorBatteryManagementCollectiveSelfConsumption_exportRateGH]]></Name>
<Folder>1756210851750</Folder>
</JavaClass>
</JavaClasses>
<RequiredLibraryReference>
<LibraryName>com.anylogic.libraries.modules.markup_descriptors</LibraryName>
Expand Down
15 changes: 14 additions & 1 deletion _alp/Agents/EnergyCoop/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1576,8 +1576,21 @@ EnergyCoop f_addAssetFlow(OL_AssetFlowCategories AC)

/*ALCODEEND*/}

List<GridConnection> f_getMemberGridConnectionsCollectionPointer()
ArrayList<GridConnection> f_getMemberGridConnectionsCollectionPointer()
{/*ALCODESTART::1754908113703*/
return this.c_memberGridConnections; // This should NOT be a copy, it should be a pointer!!
/*ALCODEEND*/}

double f_aggregatorBatteryManagement_EnergyCoop()
{/*ALCODESTART::1756207893357*/
if(p_aggregatorBatteryManagement != null){
p_aggregatorBatteryManagement.manageExternalSetpoints();
}
/*ALCODEEND*/}

double f_aggregatorManagement_EnergyCoop()
{/*ALCODESTART::1756207893363*/
//Run battery setpoint management
f_aggregatorBatteryManagement_EnergyCoop();
/*ALCODEEND*/}

34 changes: 33 additions & 1 deletion _alp/Agents/EnergyCoop/Code/Functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@
</Function>
<Function AccessType="public" StaticFunction="false">
<ReturnModificator>RETURNS_VALUE</ReturnModificator>
<ReturnType>List&lt;GridConnection&gt;</ReturnType>
<ReturnType>ArrayList&lt;GridConnection&gt;</ReturnType>
<Id>1754908113703</Id>
<Name><![CDATA[f_getMemberGridConnectionsCollectionPointer]]></Name>
<X>1440</X>
Expand All @@ -705,4 +705,36 @@
<ShowLabel>true</ShowLabel>
<Body xmlns:al="http://anylogic.com"/>
</Function>
<Function AccessType="default" StaticFunction="false">
<ReturnModificator>VOID</ReturnModificator>
<ReturnType>double</ReturnType>
<Id>1756207893357</Id>
<Name><![CDATA[f_aggregatorBatteryManagement_EnergyCoop]]></Name>
<X>670</X>
<Y>690</Y>
<Label>
<X>10</X>
<Y>0</Y>
</Label>
<PublicFlag>false</PublicFlag>
<PresentationFlag>true</PresentationFlag>
<ShowLabel>true</ShowLabel>
<Body xmlns:al="http://anylogic.com"/>
</Function>
<Function AccessType="default" StaticFunction="false">
<ReturnModificator>VOID</ReturnModificator>
<ReturnType>double</ReturnType>
<Id>1756207893363</Id>
<Name><![CDATA[f_aggregatorManagement_EnergyCoop]]></Name>
<X>650</X>
<Y>670</Y>
<Label>
<X>10</X>
<Y>0</Y>
</Label>
<PublicFlag>false</PublicFlag>
<PresentationFlag>true</PresentationFlag>
<ShowLabel>true</ShowLabel>
<Body xmlns:al="http://anylogic.com"/>
</Function>
</Functions>
25 changes: 25 additions & 0 deletions _alp/Agents/EnergyCoop/Variables.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,31 @@
</ParameterEditor>
</Properties>
</Variable>
<Variable Class="Parameter">
<Id>1756207893367</Id>
<Name><![CDATA[p_aggregatorBatteryManagement]]></Name>
<X>690</X>
<Y>710</Y>
<Label>
<X>10</X>
<Y>0</Y>
</Label>
<PublicFlag>false</PublicFlag>
<PresentationFlag>true</PresentationFlag>
<ShowLabel>true</ShowLabel>
<Properties SaveInSnapshot="true" ModificatorType="STATIC">
<Type><![CDATA[I_AggregatorBatteryManagement]]></Type>
<UnitType>NONE</UnitType>
<SdArray>false</SdArray>
<ParameterEditor>
<Id>1756207893365</Id>
<EditorContolType>TEXT_BOX</EditorContolType>
<MinSliderValue>0</MinSliderValue>
<MaxSliderValue>100</MaxSliderValue>
<DelimeterType>NO_DELIMETER</DelimeterType>
</ParameterEditor>
</Properties>
</Variable>
<Variable Class="CollectionVariable">
<Id>1679563561816</Id>
<Name><![CDATA[c_actorContracts]]></Name>
Expand Down
15 changes: 15 additions & 0 deletions _alp/Agents/EnergyModel/Code/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
}
}

//OLD LOCATION OF AGGREGATOR CALL, NECESSARY IF MANAGEMENT IS WITHOUT TIME STEP DELAY

for(GridConnection gc : c_gridConnections) { // Can't do this in parallel due to different threads writing to the same values!

fm_currentBalanceFlows_kW.addFlows(gc.fm_currentBalanceFlows_kW);
Expand All @@ -202,6 +204,9 @@
v_currentEnergyExport_kW += max( 0, -netFlow_kW );
}

//Call aggregator functions (ONLY WORK WITH TIME STEP DELAY FOR NOW) (LOCATION OF THIS CALL IS NOT DETERMINED YET, FOR NOW HERE)
f_runAggregators();

/*ALCODEEND*/}

double f_initializeForecasts()
Expand Down Expand Up @@ -1139,3 +1144,13 @@ List<GridConnection> f_getPausedGridConnectionsCollectionPointer()
return this.c_pausedGridConnections;
/*ALCODEEND*/}

double f_runAggregators()
{/*ALCODESTART::1756207695591*/
//Function used to perform central management functions (like setpoint battery steering)

//Run energy coop aggrator
for (EnergyCoop EC : pop_energyCoops) {
EC.f_aggregatorManagement_EnergyCoop();
}
/*ALCODEEND*/}

24 changes: 20 additions & 4 deletions _alp/Agents/EnergyModel/Code/Functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Id>1664894248130</Id>
<Name><![CDATA[f_updatePricesForNextTimestep]]></Name>
<X>1090</X>
<Y>290</Y>
<Y>310</Y>
<Label>
<X>10</X>
<Y>0</Y>
Expand Down Expand Up @@ -46,7 +46,7 @@
<Id>1665051878402</Id>
<Name><![CDATA[f_calculateGridnodeFlows]]></Name>
<X>1090</X>
<Y>250</Y>
<Y>270</Y>
<Label>
<X>10</X>
<Y>0</Y>
Expand All @@ -66,7 +66,7 @@
<Id>1665051962956</Id>
<Name><![CDATA[f_calculateActorFlows]]></Name>
<X>1090</X>
<Y>270</Y>
<Y>290</Y>
<Label>
<X>10</X>
<Y>0</Y>
Expand Down Expand Up @@ -444,7 +444,7 @@
<Id>1731329529733</Id>
<Name><![CDATA[f_updateLiveData]]></Name>
<X>1091</X>
<Y>313</Y>
<Y>333</Y>
<Label>
<X>10</X>
<Y>0</Y>
Expand Down Expand Up @@ -682,4 +682,20 @@
<ShowLabel>true</ShowLabel>
<Body xmlns:al="http://anylogic.com"/>
</Function>
<Function AccessType="default" StaticFunction="false">
<ReturnModificator>VOID</ReturnModificator>
<ReturnType>double</ReturnType>
<Id>1756207695591</Id>
<Name><![CDATA[f_runAggregators]]></Name>
<X>1110</X>
<Y>250</Y>
<Label>
<X>10</X>
<Y>0</Y>
</Label>
<PublicFlag>false</PublicFlag>
<PresentationFlag>true</PresentationFlag>
<ShowLabel>true</ShowLabel>
<Body xmlns:al="http://anylogic.com"/>
</Function>
</Functions>
3 changes: 3 additions & 0 deletions _alp/Agents/EnergyModel/EmbeddedObjects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@
<Parameter>
<Name><![CDATA[p_actorSubgroup]]></Name>
</Parameter>
<Parameter>
<Name><![CDATA[p_aggregatorBatteryManagement]]></Name>
</Parameter>
</Parameters>
<ReplicationFlag>true</ReplicationFlag>
<Replication Class="CodeValue">
Expand Down
8 changes: 4 additions & 4 deletions _alp/Agents/EnergyModel/Levels/Level.level.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ energyDataViewer.viewArea.navigateTo();</ActionCode>
<Id>1729238026851</Id>
<Name><![CDATA[txt_rapidRunTimeProfiling]]></Name>
<X>1143</X>
<Y>578</Y>
<Y>598</Y>
<Label>
<X>0</X>
<Y>-10</Y>
Expand All @@ -1055,7 +1055,7 @@ energyDataViewer.viewArea.navigateTo();</ActionCode>
<Id>1671703651139</Id>
<Name><![CDATA[line_rapidRunTimeProfiling]]></Name>
<X>1040</X>
<Y>600</Y>
<Y>620</Y>
<Label>
<X>10</X>
<Y>0</Y>
Expand Down Expand Up @@ -1135,7 +1135,7 @@ energyDataViewer.viewArea.navigateTo();</ActionCode>
<Id>1753355115074</Id>
<Name><![CDATA[line_timeParametersAndVariables]]></Name>
<X>1050</X>
<Y>340</Y>
<Y>360</Y>
<Label>
<X>10</X>
<Y>0</Y>
Expand Down Expand Up @@ -1163,7 +1163,7 @@ energyDataViewer.viewArea.navigateTo();</ActionCode>
<Id>1753355117052</Id>
<Name><![CDATA[txt_timeParametersAndVariables]]></Name>
<X>1150</X>
<Y>320</Y>
<Y>340</Y>
<Label>
<X>0</X>
<Y>-10</Y>
Expand Down
Loading