Package ise.mace.inputs

Examples of ise.mace.inputs.HuntResult


    }

    @Override
    public void handle(Input input)
    {
      final HuntResult in = (HuntResult)input;
      dm.foodAquired(in.getFoodReceived());
      logger.log(Level.FINE, "I, agent {0}, recieved {1} units of food",
              new Object[]
              {
                dm.getName(),
                in.getFoodReceived()
              });

      dm.setCurrentHappiness(updateHappinessAfterHunt(in.getFoodHunted(),
              in.getFoodReceived()));
      dm.setCurrentLoyalty(updateLoyaltyAfterHunt(in.getFoodHunted(),
              in.getFoodReceived()));
      Map<String, Double> t = updateTrustAfterHunt(in.getFoodHunted(),
              in.getFoodReceived());
      if (t == null) return;
      for (String agent : t.keySet())
      {
        dm.setTrust(agent, t.get(agent));
      }
View Full Code Here


      return;
    }

    if (input.getClass().equals(HuntResult.class))
    {
      final HuntResult in = (HuntResult)input;
      huntResult.put(in.getAgent(), in.getFoodHunted());
      logger.log(Level.FINE, "Agent {0} has hunted food worth {1} for {2}",
              new Object[]
              {
                ec.nameof(in.getAgent()),
                in.getFoodHunted(), dm.getName()
              });
      return;
    }

    if (input.getClass().equals(Vote.class))
View Full Code Here

        String groupID = dmodel.getAgentById(agents.get(0)).getGroupId();
        if (groupID == null)
        {
          for (String agent : agents)
          {
            sim.getPlayer(agent).enqueueInput(new HuntResult(agent, foodGained,
                    foodGained, dmodel.time));
          }
        }
        else
        {
          Participant g = sim.getPlayer(groupID);
          for (String agent : agents)
          {
            g.enqueueInput(new HuntResult(agent, foodGained, 0, dmodel.time));
          }
        }
      }
    }
View Full Code Here

      if (am.getHuntingTeam() == null)
      {
        Input result;
        if (food.getHuntersRequired() <= 1)
        {
          result = new HuntResult(actorID, food.getNutrition(),
                  food.getNutrition(), dmodel.getTime());
        }
        else
        {
          result = new HuntResult(actorID, 0, 0, dmodel.getTime());
        }
        sim.getPlayer(actorID).enqueueInput(result);
      }
      else
      {
View Full Code Here

    @Override
    public Input handle(Action action, String actorID)
    {
      final DistributeFood result = (DistributeFood)action;
      sim.getPlayer(result.getAgent()).enqueueInput(new HuntResult(actorID,
              result.getAmountHunted(), result.getAmountRecieved(),
              sim.getTime()));
      logger.log(Level.FINE, "Agent {0} was allocated {1} units of food",
              new Object[]
              {
View Full Code Here

TOP

Related Classes of ise.mace.inputs.HuntResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.