Package agentj

Examples of agentj.AgentJAgent


     * implementation instead in protolib
     *
     * @return current time in milliseconds from the start of the simulation
     */
    public static long currentTimeMillis() {
        AgentJAgent agent = AgentJVirtualMachine.getCurrentExecutingAgent();

        if (agent==null) {
            logger.fatal("No Agent available for executing getSystemTime()");
            logger.fatal("Note that System.currentTimemillis() cannot be invokved within an agent's constructor");
            java.lang.System.exit(0);
        }

        double secs = agent.getSystemTimeJava();

        //java.lang.System.out.println("System.currentTimeMillis: Time is " + secs);

        return (long)(secs*1000.0);
    }
View Full Code Here

TOP

Related Classes of agentj.AgentJAgent

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.