Tabnine Logo
ConstantStateGenerator
Code IndexAdd Tabnine to your IDE (free)

How to use
ConstantStateGenerator
in
burlap.mdp.auxiliary.common

Best Java code snippets using burlap.mdp.auxiliary.common.ConstantStateGenerator (Showing top 7 results out of 315)

origin: jmacglashan/burlap

@Override
public void setCurStateTo(State s) {
  if(this.stateGenerator == null){
    this.stateGenerator = new ConstantStateGenerator(s);
  }
  this.curState = s;
}
origin: jmacglashan/burlap

public SimulatedEnvironment(SampleModel model, State initialState) {
  this.stateGenerator = new ConstantStateGenerator(initialState);
  this.curState = initialState;
  this.model = model;
}
origin: jmacglashan/burlap

public SimulatedEnvironment(SADomain domain, State initialState) {
  this.stateGenerator = new ConstantStateGenerator(initialState);
  this.curState = initialState;
  if(domain.getModel() == null){
    throw new RuntimeException("SimulatedEnvironment requires a Domain with a model, but the input domain does not have one.");
  }
  this.model = domain.getModel();
}
origin: jmacglashan/burlap

/**
 * Initializes the world.
 * @param domain the SGDomain the world will use
 * @param jr the joint reward function
 * @param tf the terminal function
 * @param initialState the initial state of the world every time a new game starts
 */
public World(SGDomain domain, JointRewardFunction jr, TerminalFunction tf, State initialState){
  this.init(domain, domain.getJointActionModel(), jr, tf, new ConstantStateGenerator(initialState), new IdentityStateMapping());
}
origin: jmacglashan/burlap

/**
 * Plans from the input state and then returns a {@link burlap.behavior.policy.GreedyQPolicy} that greedily
 * selects the action with the highest Q-value and breaks ties uniformly randomly.
 * @param initialState the initial state of the planning problem
 * @return a {@link burlap.behavior.policy.GreedyQPolicy}.
 */
@Override
public GreedyQPolicy planFromState(State initialState) {
  if(this.model == null){
    throw new RuntimeException("LSPI cannot execute planFromState because the reward function and/or terminal function for planning have not been set. Use the initializeForPlanning method to set them.");
  }
  if(planningCollector == null){
    this.planningCollector = new SARSCollector.UniformRandomSARSCollector(this.actionTypes);
  }
  this.dataset = this.planningCollector.collectNInstances(new ConstantStateGenerator(initialState), this.model, this.numSamplesForPlanning, Integer.MAX_VALUE, this.dataset);
  return this.runPolicyIteration(this.maxNumPlanningIterations, this.maxChange);
}
origin: jmacglashan/burlap

public static void main(String[] args) {
  GridGame gg = new GridGame();
  OOSGDomain domain = gg.generateDomain();
  State s = GridGame.getTurkeyInitialState();
  JointRewardFunction jr = new GridGame.GGJointRewardFunction(domain);
  TerminalFunction tf = new GridGame.GGTerminalFunction(domain);
  World world = new World(domain, jr, tf, new ConstantStateGenerator(s));
  DPrint.toggleCode(world.getDebugId(),false);
  SGAgent ragent1 = new RandomSGAgent();
  SGAgent ragent2 = new RandomSGAgent();
  SGAgentType type = new SGAgentType("agent", domain.getActionTypes());
  world.join(ragent1);
  world.join(ragent2);
  GameEpisode ga = world.runGame(20);
  System.out.println(ga.maxTimeStep());
  String serialized = ga.serialize();
  System.out.println(serialized);
  GameEpisode read = GameEpisode.parse(serialized);
  System.out.println(read.maxTimeStep());
  System.out.println(read.state(0).toString());
}
origin: jmacglashan/burlap_examples

final ConstantStateGenerator sg = new ConstantStateGenerator(s);
burlap.mdp.auxiliary.commonConstantStateGenerator

Javadoc

This class takes a source state as input as returns copies of it for every call of generateState().

Most used methods

  • <init>
    This class takes a source state as input as returns copies of it for every call of generateState().

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now