Hi all!
I want to increase the battery discharge rate by changing the value "1.0" (the underlined one in the code) depending on dates and probabilities. For example;
If it is January, there is a 60% chance that the value is 1.0 for that day, a 35% chance that the value is 1.1 for that day, and a 5% chance that the value is 1.2 for that day. A maximum of 5 days at most in January can have the value of 1.2, 15 days 1.1, and the rest of 11 days have the value of 1. I think it should use a statistical distribution for that.
If it is not possible, while is it not the way I intended (I want randomizing) but it can use a table with values defined for 365 days and change the value accordingly. Just reference a table, and I will fill it.
The current code is given below:
/**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 = 1.0*current.dischargeRate;
return battery.value/current.dischargeRate;