Package org.rlcommunity.rlglue.codec.types

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


  public void agent_init(String taskSpec) {
    TSO = new TaskSpec(taskSpec);
    firstActionOfEpisode = true;

    action = new Action(TSO.getNumDiscreteActionDims(),TSO.getNumDiscreteActionDims())
    totalRew = 0;
    totalSteps = 0;
   
    try{
      FileInputStream fis = new FileInputStream("Qvalues.dat");
View Full Code Here


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

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

        return returnAction;
    }
View Full Code Here

        if (!policyFrozen) {
            valueFunction[lastActionInt][lastStateInt] = new_Q_sa;
        }

        /* Creating the action a different way to showcase variety */
        Action returnAction = new Action();
        returnAction.intArray = new int[]{newActionInt};

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

        return returnAction;
    }
View Full Code Here

    public void agent_init(String taskSpecString) {
    }

    public Action agent_start(Observation o) {
        stepCount = 0;
        return new Action(o);
    }
View Full Code Here

        return new Action(o);
    }

    public Action agent_step(double arg0, Observation o) {
        stepCount++;
        return new Action(o);
    }
View Full Code Here

        }
        Observation observation = network.getObservation();
        if (debug) {
            System.out.println("\t\tgot observation");
        }
        Action action = agent.agent_start(observation);
        if (debug) {
            System.out.println("\t\tgot action");
        }

        int size = Network.sizeOf(action);
View Full Code Here

    }

    protected void onAgentStep() {
        double reward = network.getDouble();
        Observation observation = network.getObservation();
        Action action = agent.agent_step(reward, observation);

        int size = Network.sizeOf(action);
        network.clearSendBuffer();
        network.putInt(Network.kAgentStep);
        network.putInt(size);
View Full Code Here

    public static Action RL_agent_start(Observation theObservation){
        checkInstance();
        if (!inited) {
            System.err.println("-- Warning From RLGlue :: RL_agent_start() was called without RL_init().");
        }
        Action returnAct=instance.RL_agent_start(theObservation);
        if (returnAct == null) {
            System.err.println("-- Warning From RLGlue :: RL_agent_start() response was NULL, that should be impossible.");
            returnAct = new Action();
        }
        return returnAct;
    }
View Full Code Here

    public static Action RL_agent_step(double theReward, Observation theObservation){
        checkInstance();
        if (!inited) {
            System.err.println("-- Warning From RLGlue :: RL_agent_step() was called without RL_init().");
        }
        Action theAction=instance.RL_agent_step(theReward, theObservation);
        if (theAction == null) {
            System.err.println("-- Warning From RLGlue :: RL_agent_step() response was NULL, that should be impossible.");
            theAction = new Action();
        }
        return theAction;
    }
View Full Code Here

*/
public class Test_Message_Agent implements AgentInterface {
    private final Action emptyAction;

    public Test_Message_Agent() {
        emptyAction=new Action(0,0,0);
    }
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.