Tabnine Logo
ConstantStateGenerator.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using burlap.mdp.auxiliary.common.ConstantStateGenerator.<init> (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<init>

Javadoc

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

Popular methods of ConstantStateGenerator

    Popular in Java

    • Reactive rest calls using spring rest template
    • setContentView (Activity)
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • getApplicationContext (Context)
    • ObjectMapper (com.fasterxml.jackson.databind)
      ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
    • Color (java.awt)
      The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
    • MalformedURLException (java.net)
      This exception is thrown when a program attempts to create an URL from an incorrect specification.
    • SecureRandom (java.security)
      This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
    • Collection (java.util)
      Collection is the root of the collection hierarchy. It defines operations on data collections and t
    • CountDownLatch (java.util.concurrent)
      A synchronization aid that allows one or more threads to wait until a set of operations being perfor
    • Top Sublime Text 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