source: src/main/java/agents/anac/y2011/ValueModelAgent/RealValuedecreaseProxy.java@ 346

Last change on this file since 346 was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.1 KB
Line 
1package agents.anac.y2011.ValueModelAgent;
2
3public class RealValuedecreaseProxy extends ValueDecrease {
4
5 private double portion;
6 private ValueDecrease worstScale;
7 RealValuedecreaseProxy(ValueDecrease worstScale,double portion) {
8 super(0, 0, 0);
9 this.portion =portion;
10 this.worstScale=worstScale;
11 }
12 @Override
13 public double getDecrease(){
14 return worstScale.getDecrease()*portion;
15 }
16 public double getReliabilty(){
17 return worstScale.getReliabilty();
18 }
19 public double getDeviance(){
20 return worstScale.getDeviance()*portion;
21 }
22 public int lastSent(){
23 return worstScale.lastSent();
24 }
25 public void sent(int bidIndex){
26 worstScale.sent(bidIndex);
27 }
28 public void updateWithNewValue(double newVal,double newReliability){
29 //if portion is 0, than this is the best case scenario...
30 //unless I add a way to turn the linear direction of the issue
31 //there is nothing we can learn from newVal, and any other value
32 //but 0 is considered a mistake
33 if(portion>0){
34 worstScale.updateWithNewValue(newVal/portion, newReliability);
35 }
36 }
37
38}
Note: See TracBrowser for help on using the repository browser.