Ejemplo n.º 1
0
  private void handleICampaignOpportunityMessage(CampaignOpportunityMessage com) {

    w.day = com.getDay();

    d.pendingCampaign = new CampaignData(com);
    System.out.println("Day " + w.day + ": Campaign opportunity - " + d.pendingCampaign);

    // -------------Leela Campaign Bid--------------
    long cmpBidMillis = ca.bidValue(com);
    System.out.println("Day " + w.day + ": Campaign total budget bid (millis): " + cmpBidMillis);

    if (d.dailyNotification != null) {

      d.ucsBid = ua.bidValue();
      d.lastUCS = d.ucsBid;
      System.out.println(
          "Day " + w.day + ": ucs level reported: " + d.dailyNotification.getServiceLevel());
    } else {
      System.out.println("Day " + w.day + ": Initial ucs bid is " + d.ucsBid);
    }
    /* Note: Campaign bid is in millis */
    AdNetBidMessage bids;
    /*if(shouldBid){
        bids = new AdNetBidMessage(ucsBid, d.pendingCampaign.id, cmpBidMillis);
    }
    else{
        bids = new AdNetBidMessage(0.1, d.pendingCampaign.id, cmpimps);
        System.out.println("DID NOT BID! OVERLAP!!");
    }*/
    // cmpBidMillis=(long)(cmpimps*0.1);
    bids = new AdNetBidMessage(d.ucsBid, d.pendingCampaign.id, cmpBidMillis);
    sendMessage(demandAgentAddress, bids);
  }
Ejemplo n.º 2
0
  @Override
  protected void simulationSetup() {

    w.day = 0;
    d.bidBundle = new AdxBidBundle();

    /* initial bid between 0.1 and 0.2 */
    d.ucsBid = 0.2;

    d.campaigns = new HashMap<Integer, CampaignData>();
    log.fine("AdNet " + getName() + " simulationSetup");
  }