You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a test case to evaluate the heat-capacitor strategy.
It uses the temperature data of my own heat pump.
The idea behind it:
I'd like to use the strategy to load the hot water tank at cheapest tibber prices.
So, the complete configuration for the strategy will be set before starting a calculation,
because the configuration data is dependent on the tank temperature and the current consumption of hot water.
My test case executes the same procedure for different values.
The output will be validated against the expected reaction.
This is still in progress.
However, when testing it, I came across the following issue:
strategy-heat-capacitor-functions.js:22
If pattern.length == 0, the reduce() call of the dot() function will throw an exception
19 const dot = (a, b) => a.map((x, i) => a[i] * b[i]).reduce((m, n) => m + n);
20 const procurementOpportunities = Array(prices.length * 60 - pattern.length + 1);
21 for (let i = 0; i < procurementOpportunities.length; i++) {
22 procurementOpportunities[i] = dot(weightedPattern, tempPrice.slice(i, i + pattern.length));
23 }
24 return procurementOpportunities;
I needed to change a little of the code in src/strategy-heat-capacitor.js.
The component used Date.now() instead of msg.payload.time.
The test case use the time field to identify the test data.
Hi,
I am working on a test case to evaluate the heat-capacitor strategy.
It uses the temperature data of my own heat pump.
The idea behind it:
I'd like to use the strategy to load the hot water tank at cheapest tibber prices.
So, the complete configuration for the strategy will be set before starting a calculation,
because the configuration data is dependent on the tank temperature and the current consumption of hot water.
My test case executes the same procedure for different values.
The output will be validated against the expected reaction.
This is still in progress.
However, when testing it, I came across the following issue:
strategy-heat-capacitor-functions.js:22
If pattern.length == 0, the reduce() call of the dot() function will throw an exception
you can repdroduce this using the source code at
https://github.com/volkmarnissen/node-red-contrib-power-saver/tree/heat-capacitor-hot-water
The test case "ps-strategy-heat-capacitor hot water" will fail when processing the 5th set of data.
msg.payload.time == '2021-10-11T00:30:00.004+02:00
The text was updated successfully, but these errors were encountered: