Package ise.mace.actions

Examples of ise.mace.actions.DistributeFood


    List<String> informedAgents = new ArrayList<String>();

    for (String agent : result.keySet())
    {
      informedAgents.add(agent);
      ec.act(new DistributeFood(agent, huntResult.get(agent), result.get(agent)),
              getId(), authCode);
    }

    @SuppressWarnings("unchecked")
    List<String> uninformedAgents = new ArrayList<String>(dm.getMemberList());
    uninformedAgents.removeAll(informedAgents);

    for (String agent : uninformedAgents)
    {
      ec.act(new DistributeFood(agent, 0, shared), getId(), authCode);
    }
  }
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[]
              {
                nameOf(result.getAgent()),
                result.getAmountRecieved()
              });
      return null;
    }
View Full Code Here

TOP

Related Classes of ise.mace.actions.DistributeFood

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.