def __call__(self,dummy=0): agentList = [] agentList.append(targetPriceDist(margDistPricePrediction = self.margDistPrediction, name = 'targetPrice')) agentList.append(riskAware(margDistPricePrediction = self.margDistPrediction, A = self.A, name = 'riskAware_A={0}'.format(self.A))) agentList.append(straightMU8(margDistPricePrediction = self.margDistPrediction, name = 'straighMU8')) agentList.append(targetMU8(margDistPricePrediction = self.margDistPrediction, name = 'targetMU8')) agentList.append(targetMUS8(margDistPricePrediction = self.margDistPrediction, name = 'targetMUS8')) agentSurplus = [] for g in range(0,self.nGames): # print 'Iteration = {0}'.format(g) v = numpy.random.random_integers(low=0,high=50,size=5) v.sort() #sort is in ascending order, #switch around for descending v = v[::-1] l = numpy.random.random_integers(low=1,high=5) #each game set all the valuations and lambdas to be equal #for fair evaulation (symmetric game) for agent in agentList: agent.v = v agent.l = l auction = simultaneousAuction(agentList) auction.runAuction() auction.notifyAgents() agentSurplus.append(auction.agentSurplus()) return numpy.atleast_2d(agentSurplus).astype(numpy.float)
def __call__(self, dummy=0): agentSurplus = [] for i in xrange(self.nGames): # print 'Iteration = {0}'.format(i) agentList = [] riskAware1 = riskAware( margDistPricePrediction=self.margDistPrediction, A=0, name="riskAware_A={0}".format(0) ) agentList.append( targetPriceDist( margDistPricePrediction=self.margDistPrediction, v=riskAware1.v, name="targetPrice", l=riskAware1.l ) ) agentList.append(riskAware1) for A in xrange(2, 30, 2): agentList.append( riskAware( margDistPricePrediction=self.margDistPrediction, A=A, name="riskAware_A={0}".format(A), v=riskAware1.v, l=riskAware1.l, ) ) auction = simultaneousAuction(agentList) auction.runAuction() auction.notifyAgents() agentSurplus.append(auction.agentSurplus()) return numpy.atleast_2d(agentSurplus).astype(numpy.float)