Can brokers use TariffEvaluationHelper and other components?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can brokers use TariffEvaluationHelper and other components?

grampajohn
Administrator
Daniel asks:
Are the TariffEvaluationHelper, Tariff, and TariffEvaluator classes intended to be used by brokers? is it OK if they are?
I always assumed brokers would want to use Tariff and TariffEvaluationHelper to evaluate their own and competing tariffs. They are in the common module, so they are already part of any broker build.

TariffEvaluator is in server-interface, which is a server-specific extension of common. However, if you find it useful, you are of course welcome to use it. You might need to extend it a bit for broker application, but it might be enough to just implement a custom CustomerModelAccessor.

I would be very interested to know how these tools work for you.

Cheers -

John
Reply | Threaded
Open this post in threaded view
|

Re: Can brokers use TariffEvaluationHelper and other components?

turban
Hey,

I also tried to use the TariffEvaluationHelper. I noticed that the estimateCost() always returns the same value, no matter which usage data I pass to the method. See examples below. Does this mean that the tariff has the same “utility” for all the customer groups, or am I missing something? By the Way I used a simple flat tariff in this scenario.

Examples:
Village 1 SS Controllable|  utility: -0.7837500000000001         Data: [-0.897, -2.0669, -2.3571999999999997, -2.3571999999999997, -2.3571999999999997, -1.4602, -0.5892999999999999, -0.5892999999999999, -0.5892999999999999, -1.0829, -0.0, -0.3432, -0.35350000000000004, -0.7599, -0.48840000000000006, -0.4436, -1.0516, -1.1983000000000001]
Village 1 RaS Controllable|  utility: -0.7837500000000001         Data: [-0.897, -2.0669, -2.3571999999999997, -2.3571999999999997, -2.3571999999999997, -1.4602, -0.5892999999999999, -0.5892999999999999, -0.5892999999999999, -1.0829, -0.0, -0.3432, -0.35350000000000004, -0.7599, -0.48840000000000006, -0.4436, -1.0516, -1.1983000000000001]
OfficeComplex 2 SS Controllable| utility: -0.7837500000000001         Data: [-0.41966666666666663, -0.41966666666666663, -0.41966666666666663, -0.41966666666666663, -0.41966666666666663, -0.41966666666666663, -0.8476666666666667, -0.783, -0.981, -0.9603333333333333, -0.783, -2.3013333333333335, -3.39, -0.783, -0.8923333333333333, -0.783, -0.5983333333333333, -0.5983333333333333]
CentervilleHomes|  utility: -0.7837500000000001         Data: [-0.40438, -0.51256, -0.506124, -0.616751, -0.5519925, -0.603835, -0.6785065, -0.579784, -0.559589, -0.5814895, -0.569259, -0.5587085, -0.6977985, -0.6705774999999999, -0.835201, -0.938911, -1.0123915, -1.1180465]
OfficeComplex 1 SS Controllable|  utility: -0.7837500000000001         Data: [-0.302, -0.302, -0.302, -0.302, -0.302, -0.302, -0.8290000000000001, -0.8293333333333334, -1.2113333333333334, -1.0493333333333335, -0.8293333333333334, -2.731, -2.466666666666667, -0.904, -0.8293333333333334, -0.8293333333333334, -0.602, -0.602]
Village 2 RaS Base| utility: -0.7837500000000001         Data: [-0.3996, -0.3996, -0.3996, -0.3996, -3.6264000000000003, -2.7634, -1.4574, -1.4884, -1.0987, -0.7493000000000001, -0.7102, -0.5321, -1.3739000000000001, -2.076, -2.9732, -3.6517000000000004, -3.3832, -3.8379]
Village 2 SS Base| utility: -0.7837500000000001 Data: [-0.3996, -0.3996, -0.3996, -0.3996, -3.6264000000000003, -2.7634, -1.4574, -1.4884, -1.0987, -0.7493000000000001, -0.7102, -0.5321, -1.3739000000000001, -2.076, -2.9732, -3.6517000000000004, -3.3832, -3.8379]
Village 1 NS Base|  utility: -0.7837500000000001         Data: [-0.3754, -0.3754, -0.3754, -0.3754, -7.5738, -3.8107999999999995, -2.9651, -4.1475, -0.7984, -0.9205, -0.5204, -0.8255000000000001, -1.0576, -6.038, -7.066599999999999, -5.4006, -5.6183, -5.6887]
OfficeComplex 1 NS Controllable|  utility: -0.7837500000000001         Data: [-0.37120000000000003, -0.37120000000000003, -0.37120000000000003, -0.37120000000000003, -0.37120000000000003, -0.37120000000000003, -0.9570000000000001, -0.9822, -0.9194000000000001, -0.9789999999999999, -0.9194000000000001, -2.3760000000000003, -1.6518000000000002, -0.8503999999999999, -0.7986, -0.8488, -0.6352, -0.6352]
DowntownOffices| utility: -0.7837500000000001         Data: [-49.36133333333333, -51.72233333333334, -70.30933333333334, -89.46266666666666, -108.529, -138.80966666666666, -164.8756666666667, -169.88566666666665, -165.00333333333336, -165.34466666666668, -159.31199999999998, -171.53733333333332, -173.80766666666665, -184.728, -179.38433333333333, -154.56266666666667, -113.751, -88.81099999999999]

Here is my code if it helps.
  TariffEvaluationHelper th = new TariffEvaluationHelper();
        th.init();
        double utility = 0D;

        for (Map.Entry<String, LinkedList<Double>> entrySet : this.predictor.getTrainData().entrySet()) {
            String key = entrySet.getKey();
            LinkedList<Double> value = entrySet.getValue();
            utility += th.estimateCost(tariff, ArrayUtils.toPrimitive(value.toArray(new Double[value.size()])), true);
            System.out.println(key + "|\t utility: " + th.estimateCost(tariff, ArrayUtils.toPrimitive(value.toArray(new Double[value.size()])), true) + "\t Data: " + Arrays.toString(ArrayUtils.toPrimitive(value.toArray(new Double[value.size()]))));
        }
        return (utility);

Greetings,
Tobias
Reply | Threaded
Open this post in threaded view
|

Re: Can brokers use TariffEvaluationHelper and other components?

grampajohn
Administrator
Hello, Tobias -

turban wrote
I also tried to use the TariffEvaluationHelper. I noticed that the estimateCost() always returns the same value, no matter which usage data I pass to the method. See examples below. Does this mean that the tariff has the same “utility” for all the customer groups, or am I missing something? By the Way I used a simple flat tariff in this scenario.
This looks correct to me. The utility value is scaled to usage, so total usage in the supplied profile is factored out. Since you are using a flat tariff, the values you get will be determined by the evaluation parameters you supply - there will be no difference between different usage profiles.

Also note that customers also use "inconvenience factors" to discount the rates for tiered, time-of-use, variable-price, and interruptible tariffs. Those values are not appied in the TariffEvaluationHelper, but rather in the TariffEvaluator, part of the server and not visible to brokers. Commercial and industrial customers generally are more willing to use such tariffs; residential customers will need to see larger savings before they will subscribe to such tariffs.

If you want to see some differences, you will need to use tiered or time-of-use or variable-rate tariffs.

Does this help?

John
Reply | Threaded
Open this post in threaded view
|

Re: Can brokers use TariffEvaluationHelper and other components?

turban
Hey John,

Thanks for this fast reply! I think there was another problem. After looking into my brokers log I found this: “106691 ERROR common.Tariff: uninitialized tariff 200000019. I added this line of code “tariff.init();” to my method in order to resolve the issue. I think there was a problem because the tariff wasn’t published yet. Now I get different “utility” values (with a flat tariff).

Is there any public information about these factors, so that I can (at least somehow) deal with them? The game specification just says that there is this factor.

Examples: (flat tariff)
Village 2 ReS Controllable| utility: 0.5408768087102498 Data: [D@14bb40e
HextraChemical| utility: 95.97461318313704 Data: [D@1f9a607
Village 2 NS Controllable| utility: 0.5906824843362586 Data: [D@194acb9
OfficeComplex 2 SS Base| utility: 2.634550971123451 Data: [D@1fe73
Village 2 SS Controllable| utility: 0.5408768087102498 Data: [D@94c9f9
MedicalCenter@1| utility: 10304.062207889156 Data: [D@4989f2

Examples: (time-of-use tariff)
Village 2 ReS Base| utility: 3.2393290377461414 Data: [D@2c5609
Village 2 ReS Controllable| utility: 1.486432538124668 Data: [D@7cb37f
HextraChemical| utility: 99.47123809566648 Data: [D@1497ebb
OfficeComplex 2 SS Base| utility: -0.11741843445485342 Data: [D@1882961
Village 2 NS Controllable| utility: 1.241419434611303 Data: [D@1e2af87
Village 2 SS Controllable| utility: 1.486432538124668 Data: [D@6e198f
MedicalCenter@1| utility: 10230.528073486186 Data: [D@1614df
freezeco-1| utility: 62.54969853684306 Data: [D@b3f95d
Village 1 ReS Controllable| utility: 0.3353803281632885 Data: [D@e9f35b
Village 2 RaS Controllable| utility: 1.486432538124668 Data: [D@812b28
Village 1 NS Controllable| utility: 2.099235630319378 Data: [D@ff75cb

Greetings
Tobias