/** * Interface for all-to-all broadcast algorithms * @author mds * */ public interface IPosBcast extends ILogicVarBundle { /* should implement IAgent functionality */ /** * @return dimensionality in which these agents live */ public int getDim(); /** * Returns true if the information on this agent is valid, false otherwise * @param nAgent unique identifier of agent we are requesting the position of * @return true if we have any info */ public boolean haveInfo(int nAgent); /** * Returns true if the information on each agent is valid, false otherwise * @return true if we have info for every agent */ public boolean haveAllInfo(); /** * Gets the most recent known position of agent nAgent * @param nAgent unique identifier of agent we are requesting the position of * @return position array */ public double [] getPos(int nAgent); /** * Gets the time when the position estimate for nAgent was last valid * @param nAgent unique identifier of agent we are requesting info about * @return time position data for nAgent was last valid */ public double getLastTime(int nAgent); public interface IPosBcastMsg extends IMsg { public int getNumEntries(); public int getId(int nEntry); public double getTime(int nEntry); public double [] getPos(int nEntry); } /** * Gets number of agents in swarm * @return number of agents */ public int getNumAgents(); /** * not neccessarily const, could modify state * @return */ public IPosBcastMsg getMsg(); public void forceUpdate(int nId, double [] arrLfPos, double lfTime); }