Examples of Observation


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

        numSteps = 0;
        return taskSpec;
    }

    public synchronized Observation_action RL_start() {
        Observation o = RL_env_start();
        lastAction = RL_agent_start(o);
        Observation_action ao = new Observation_action(o, lastAction);
        return ao;
    }
View Full Code Here

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

    public synchronized Observation RL_env_start() {
        numSteps = 1;
        isTerminal = false;
        totalReward = 0.0d;

        Observation o = E.env_start();
        if (o == null) {
            System.err.println("o came back as null from RL_start");
        }
        return o;
    }
View Full Code Here

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

    return (theValue - minPossible) / (maxPossible - minPossible);
  }

  public static Observation cloneObservation(Observation theObs) {

    Observation newObs = new Observation(theObs.intArray.length,
        theObs.doubleArray.length);
    for (int i = 0; i < theObs.intArray.length; i++) {
      newObs.intArray[i] = theObs.intArray[i];
    }
    for (int i = 0; i < theObs.doubleArray.length; i++) {
View Full Code Here

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

    for (int i = 0; i < theDoubles.length; i++) {
      theDoubles[i] = Double.parseDouble(obsTokenizer.nextToken());
    }

    Observation theObs = new Observation(theIntCount, theDoubleCount);
    theObs.intArray = theInts;
    theObs.doubleArray = theDoubles;

    return theObs;
  }
View Full Code Here

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

            RLGlue.RL_init();
        }


        if (RLGlue.isCurrentEpisodeOver()) {
            Observation firstObservation = RLGlue.RL_env_start();


            synchronized (this) {
                lastObservation = firstObservation;
                lastReward = Double.NaN;
View Full Code Here

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

    }

    public Observation env_start() {
        currentState=10;
       
        Observation returnObservation=new Observation(1,0,0);
        returnObservation.intArray[0]=currentState;
        return returnObservation;
    }
View Full Code Here

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

                theWorld.setRandomAgentState();
            }
        } else {
            theWorld.setRandomAgentState();
        }
        Observation theObservation = new Observation(1, 0, 0);
        theObservation.setInt(0, theWorld.getState());
        return theObservation;
    }
View Full Code Here

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

        assert (thisAction.getInt(0) < 4) : "Action should be in [0,4], " + thisAction.getInt(0) + " was provided";

        theWorld.updatePosition(thisAction.getInt(0));


        Observation theObservation = new Observation(1, 0, 0);
        theObservation.setInt(0, theWorld.getState());
        Reward_observation_terminal RewardObs = new Reward_observation_terminal();
        RewardObs.setObservation(theObservation);
        RewardObs.setTerminal(theWorld.isTerminal());
        RewardObs.setReward(theWorld.getReward());
View Full Code Here

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

  public String handleAutomatically(EnvironmentInterface theEnvironment) {
    Vector<Observation> theObservations= new Vector<Observation>();
    getEnvObsForStateInterface castedEnv=(getEnvObsForStateInterface)theEnvironment;
   
    for(int i=0;i<theRequestStates.size();i++){
      Observation thisObs=castedEnv.getObservationForState(theRequestStates.get(i));
      theObservations.add(thisObs);
    }

    EnvObsForStateResponse theResponse = new EnvObsForStateResponse(theObservations);
    return theResponse.makeStringResponse();
View Full Code Here

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

        if(currentState>=20){
            currentState=20;
            episodeOver=true;
            theReward=1.0d;
        }
        Observation returnObservation=new Observation(1,0,0);
        returnObservation.intArray[0]=currentState;
       
        Reward_observation_terminal returnRewardObs=new Reward_observation_terminal(theReward,returnObservation,episodeOver);
        return returnRewardObs;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.