Package org.rlcommunity.rlglue.codec.types

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


        return gamecontroller.waitForMoves();
    }
   
    private Observation createObservation(RState state)
    {
        Observation observation = new Observation();
       
        Set<GroundFact> set = state.getGroundFactState();
        String s = "";
        for (GroundFact fact : set)
        {
View Full Code Here


        currentState = 0;
        // Se crea una observacion(estado) formado
        // por un vector de 2 entero que denotan
        // el estado actual y el numero de estados totales
        // que hay actualmente
        Observation returnObservation = new Observation(2, 0, 0);
        // Se asigna a la posicion 0 el estado actual
        returnObservation.intArray[0] = currentState;
        // Se asigna a la posicion 1 el numero de estados
        returnObservation.intArray[1] = numStates;
        // Se devuele el estado creado
View Full Code Here

        theReward = currentReward;
        // Se crea una observacion(estado) formado
        // por un vector de 2 entero que denotan
        // el estado actual y el numero de estados totales
        // que hay actualmente
        Observation returnObservation = new Observation(2, 0, 0);
        // Se asigna a la posicion 0 el estado actual
        returnObservation.intArray[0] = currentState;
        // Se asigna a la posicion 1 el numero de estados
        returnObservation.intArray[1] = numStates;
        // Se crea un clase Reward_observation_terminal
View Full Code Here

        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

    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

    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

    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

            RLGlue.RL_init();
        }


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


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

    }

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

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

TOP

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

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.