Package fr.irit.halterego.jocular

Examples of fr.irit.halterego.jocular.Experiment


            logger_.severe(gameId_ + ": Previous move list in STOP message was not a GDL list!");
            finish();
            return;
        }
       
        Experiment exp = ExperimentManager.getExp(gameId_);
        if(exp == null)
        {
            logger_.severe("No game found for play request ID: " + gameId_);
            finish();
            return;
        }
       
        exp.getGC().setMoves((GdlList)prevMoves);
        
        ExperimentManager.endExp(gameId_);
     
        //long start= System.currentTimeMillis();
        synchronized(exp)
View Full Code Here


            if ( prevExp instanceof GdlAtom == false || prevExp.equals( GameManager.getParser().TOK_NIL ) == false )
                throw new IllegalArgumentException("PLAY request doesn't have LIST and doesn't have NIL atom as prev-moves!");
            prevMoves = null; // empty prev moves
        }
       
        final Experiment exp = ExperimentManager.getExp(gameId_);
        if(exp == null)
        {
            logger_.severe("No running experiment found for play request ID: " + gameId_);
            finish();
            return;
        }
       
        logger_.info(gameId_ + ": applying moves " + prevMovesStr);
       
        if(prevMoves != null)
        {
            exp.getGC().setMoves(prevMoves);
        }
       
        new Thread()
        {
            public void run()
            {
                try
                {
                    synchronized(exp)
                    {
                        exp.getGC().setRequestHandler(PlayRequestHandler.this);
                        if(prevMoves == null)
                        {
                            exp.start();
                        }
                        else
                        {
                            exp.step();
                        }
                    }
                }
                catch(Exception e)
                {
View Full Code Here

        {
            throw new IllegalArgumentException( "START request should have exactly six arguments, not "
                    + content_.getSize() );
        }
       
        final Experiment exp = ExperimentManager.createExp(gameId_);
       
        if (exp != null)
        {
            logger_.info(gameId_ + ": Experiment successfully created.");
        }
        else
        {
            logger_.severe(gameId_ + ": Could not create experiment from start message!");
        }
        
        synchronized(exp)
        {
            exp.init(content_);
        }
       
        // Tell Game Master that we're ready.
        sendAnswer("READY");
               
View Full Code Here

TOP

Related Classes of fr.irit.halterego.jocular.Experiment

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.