import java.util.Collection; /** * IAgent was too cumbersome -- this requires functions which do equivalent things * but with simpler signatures. * @author mds * */ public interface ISimpAgent { /** * Given a collection of messages, calculates the next state of the logic * variables for this agent. IAgent wrapper would call this after running * AccumMsgs to create the message bag. * @param bagMsg collection of messages to process (usually these should include * the id of the sending agent!!!) * @return next state of the logic variables for this agent (no control function) */ public TVars stateNext(TVars varsPrev, Collection bagMsg); /** * Gets one individual IMsg to send to one specific agent. * IAgent wrapper for this class would call this in a loop and push * the results onto CommLink objects. * @param varsPrev current state of this agent * @param nIdDst UID of agent to send message to * @return message to send to agent nIdDst */ public TMsg getMsg(TVars varsPrev, int nIdDst); }