package agents.anac.y2011.ValueModelAgent; import genius.core.Bid; import genius.core.issue.Value; import genius.core.utility.AdditiveUtilitySpace; public class ValueModeler { public boolean initialized=false; AdditiveUtilitySpace utilitySpace; IssuesDecreases[] issues; //initializing the opponenent model with the opponentFirstBid, //which is assumed to be the best bid possible public void initialize(AdditiveUtilitySpace space,Bid firstBid) throws Exception{ initialized=true; utilitySpace = space; int issueCount = utilitySpace.getDomain().getIssues().size(); issues = new IssuesDecreases[issueCount]; for(int i =0; i1/2){ return (1/(reliability*reliability))/issues.length; } if(reliability>1/4){ return (2/reliability)/issues.length; } if(reliability>0){ return (4/Math.sqrt(reliability))/issues.length; } //this case shouldn't be reached return 1000; } //the bid utility for the player is assumed to be 1-expectedDecrease public void assumeBidWorth(Bid bid,double expectedDecrease,double stdDev) throws Exception{ ValueDecrease[] values = new ValueDecrease[issues.length]; double maxReliableDecrease=0; for(int i=0;i0.8){ maxReliableDecrease=values[i].getDecrease(); } } ValueDecrease origEvaluation=utilityLoss(bid); double unitsToMove = (expectedDecrease-origEvaluation.getDecrease())/deviationUnit; for(int i=0;i0.7 || maxReliableDecrease0){ values[i].updateWithNewValue(newVal, origEvaluation.getReliabilty()); } else values[i].updateWithNewValue(0, origEvaluation.getReliabilty()); } //assumes that new unreliable values costs more than previously seen values. //if our opponent selected a bid that costs 10%, //that is split between values that costs 4%,6%. //than if 4%->6% we will think that 6%->4%. //worst this sway also influences the estimate //of our opponent's concession, so we may think he //Consented to 7% and 6%->1%. //both issues require this failsafe... //else values[i].updateWithNewValue(maxReliableDecrease, origEvaluation.getReliabilty()); else values[i].updateWithNewValue(newVal, origEvaluation.getReliabilty()); } normalize(); } public ValueDecrease utilityLoss(Bid bid) throws Exception{ ValueDecrease[] values = new ValueDecrease[issues.length]; for(int i=0;i0?rel:0.01; sumSQ += (1/rel)*(1/rel); } //added postBG sumSQ/=issues.length; double rel = Math.sqrt(1/sumSQ); return new ValueDecrease(decrease,rel,stdDev); } public IssuesDecreases getIssue(int index){ if(index=0){ return issues[index]; } return issues[0]; } }