Hi all,
I hope you all are fine and healthy during this testing times.
I need help on customs coding. In v5, we have completed the battery discharging code thanks to your help. In v6, we are adding the renewable charging component to the model. I throwed in some comments and pseudo codes in custom codes in the model in the hopes of guiding you.
What needs to be done is as follows:
1) SetRenewableRate is the logic for solar energy charging. It needs to select corresponding value from the global tale RenewableRatesTable, depending on the month and hour and then define the global variable "hourlyRenewableRate". Therefore, ALL custom codes only in SetRenewableRate logic needs fixing. That is all I need.
2) Code below needs to be changed so that it selects a predefined shipPVCapacity value for each ship depeding on the name of the ship. Defined the values as labels to ships, manually.
/**Custom Code*/ Object current = param(1); treenode activity = param(2); Token token = param(3); Variant assignTo = param(4); string labelName = param(5); treenode processFlow = ownerobject(activity); TrackedVariable battery = current.labels["Battery"]; battery.rate = dailyDischargeRate*current.dischargeRate + hourlyRenewableRate*shipPVCapacity/1000 ; //We need to define shipPVCapacity for 4 groups depending on names of transports. //LC1 to LC13, F1 and F3, F2 and F4, and HSC1-2 //something like this: if Model.name is "LC1" then shipPVCapacity == "750" //These values needs to be set only once. return battery.value/current.dischargeRate;