/** * On day n ( > 0), the result of the UserClassificationService and Campaign auctions (for which * the competing agents sent bids during day n -1) are reported. The reported Campaign starts in * day n+1 or later and the user classification service level is applicable starting from day n+1. */ private void handleAdNetworkDailyNotification(AdNetworkDailyNotification notificationMessage) { d.dailyNotification = notificationMessage; System.out.println( "Day " + w.day + ": Daily notification for campaign " + d.dailyNotification.getCampaignId()); String campaignAllocatedTo = " allocated to " + notificationMessage.getWinner(); if ((d.pendingCampaign.id == d.dailyNotification.getCampaignId()) && (notificationMessage.getCostMillis() != 0)) { /* add campaign to list of won campaigns */ d.pendingCampaign.setBudget(notificationMessage.getCostMillis() / 1000.0); d.currCampaign = d.pendingCampaign; genCampaignQueries(d.currCampaign); d.campaigns.put(d.pendingCampaign.id, d.pendingCampaign); for (int i = (int) d.pendingCampaign.dayStart; i <= (int) d.pendingCampaign.dayEnd; i++) { d.campTrack.get(i).add(d.pendingCampaign.id); } campaignAllocatedTo = " WON at cost (Millis)" + notificationMessage.getCostMillis(); em.pastQBWon.add( notificationMessage.getQualityScore() / (notificationMessage.getPrice() / d.currCampaign.reachImps)); } else { em.pastQBLost.add( notificationMessage.getQualityScore() / (notificationMessage.getPrice() / d.pendingCampaign.reachImps)); for (int i = (int) d.pendingCampaign.dayStart; i <= (int) d.pendingCampaign.dayEnd; i++) { d.otherCampTrack.get(i).add(d.pendingCampaign.id); } } System.out.println( "Day " + w.day + ": " + campaignAllocatedTo + ". UCS Level set to " + notificationMessage.getServiceLevel() + " at price " + notificationMessage.getPrice() + " Quality Score is: " + notificationMessage.getQualityScore()); }