Package org.rlcommunity.rlglue.codec.types

Examples of org.rlcommunity.rlglue.codec.types.Action


        algorithm.save();
    }
   
    private Action createRLGlueAction(RAction action)
    {
        Action ret = new Action();
        ret.charArray = action.getGroundFact().toString().toCharArray();
        return ret;
    }
View Full Code Here


        return gamecontroller;
    }
   
    public void start()
    {
        Action action = RLGlue.RL_agent_start(RLGlue.RL_env_start());
        Reward_observation_terminal rot = RLGlue.RL_env_step(action);
        reward = rot.getReward();
        observation = rot.getObservation();
       
        if(observation == null)
View Full Code Here

        if(observation == null)
        {
            throw new RuntimeException("observation should not be null");
        }
       
        Action action = RLGlue.RL_agent_step(reward,observation);
        Reward_observation_terminal rot = RLGlue.RL_env_step(action);
        reward = rot.getReward();
        observation = rot.getObservation();
       
        if(rot.isTerminal())
View Full Code Here

        actions[1].discreteAction = actions[0].discreteAction;
        int theIntAction = actions[0].discreteAction;
        /**
         * Create a structure to hold 1 integer action and set the value
         */
        Action returnAction = new Action(1, 0, 0);
        returnAction.intArray[0] = theIntAction;
        lastAction = returnAction.duplicate();
        lastObservation = observation.duplicate();
        return returnAction;
    }
View Full Code Here

        }
        algorithm.update(lastS, actions, reward, newS, learning_rat, 1);
        // Se devuelve la accion obtenida y se guarda dicha accion y el estado
        // actual como
        // lastAction y lastObservation respectivamente
        Action returnAction = new Action();
        returnAction.intArray = new int[] { theIntAction };
        lastAction = returnAction.duplicate();
        lastObservation = observation.duplicate();
        return returnAction;
    }
View Full Code Here

            System.err.println("o came back as null from RL_start");
        }
        return o;
    }
    public synchronized Action RL_agent_start(Observation theObservation) {
        Action theAction=A.agent_start(theObservation);
            if (theAction == null) {
            System.err.println("theAction came back as null from RL_start");
        }
        return theAction;
    }
View Full Code Here

        return RO;
    }


    public synchronized Action RL_agent_step( double theReward, Observation theObservation) {
        Action theAction=A.agent_step(theReward, theObservation);
            if (theAction == null) {
                System.err.println("theAction came back as null from agent_step");
            }
        return theAction;
    }
View Full Code Here

                timeStep = 1;
                totalSteps++;
                returnThisEpisode = 0.0d;
            }
            updateObservers(firstObservation);
            Action firstAction = RLGlue.RL_agent_start(firstObservation);

            synchronized (this) {
                lastAction = firstAction;
            }
            updateObservers(firstAction);
View Full Code Here

        int theIntAction = randGenerator.nextInt(2);
        /**
         * Create a structure to hold 1 integer action
         * and set the value
         */
        Action returnAction = new Action(1, 0, 0);
        returnAction.intArray[0] = theIntAction;

        lastAction = returnAction.duplicate();
        lastObservation = observation.duplicate();

        return returnAction;
    }
View Full Code Here

        int theIntAction = randGenerator.nextInt(2);
        /**
         * Create a structure to hold 1 integer action
         * and set the value (alternate method)
         */
        Action returnAction = new Action();
        returnAction.intArray = new int[]{theIntAction};

        lastAction = returnAction.duplicate();
        lastObservation = observation.duplicate();

        return returnAction;
    }
View Full Code Here

TOP

Related Classes of org.rlcommunity.rlglue.codec.types.Action

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.