当前位置: 首页>>代码示例>>Java>>正文


Java RandomPolicy类代码示例

本文整理汇总了Java中burlap.behavior.policy.RandomPolicy的典型用法代码示例。如果您正苦于以下问题:Java RandomPolicy类的具体用法?Java RandomPolicy怎么用?Java RandomPolicy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RandomPolicy类属于burlap.behavior.policy包,在下文中一共展示了RandomPolicy类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DeepQLearner

import burlap.behavior.policy.RandomPolicy; //导入依赖的package包/类
public DeepQLearner(SADomain domain, double gamma, int replayStartSize, Policy policy, DQN vfa, StateMapping stateMapping) {
    super(domain, gamma, vfa, stateMapping);

    if (replayStartSize > 0) {
        System.out.println(String.format("Starting with random policy for %d frames", replayStartSize));

        this.replayStartSize = replayStartSize;
        this.trainingPolicy = policy;
        setLearningPolicy(new RandomPolicy(domain));
        runningRandomPolicy = true;
    } else {
        setLearningPolicy(policy);

        runningRandomPolicy = false;
    }
}
 
开发者ID:h2r,项目名称:burlap_caffe,代码行数:17,代码来源:DeepQLearner.java

示例2: main

import burlap.behavior.policy.RandomPolicy; //导入依赖的package包/类
public static void main(String[] args) {
	GridWorldDomain gwd = new GridWorldDomain(11, 11);
	Domain domain = gwd.generateDomain();
	State s = GridWorldDomain.getOneAgentNoLocationState(domain, 1, 3);

	Policy p = new RandomPolicy(domain);
	EpisodeAnalysis ea = p.evaluateBehavior(s, new NullRewardFunction(), new NullTermination(), 30);

	String yamlOut = ea.serialize();

	System.out.println(yamlOut);

	System.out.println("\n\n");

	EpisodeAnalysis read = EpisodeAnalysis.parseEpisode(domain, yamlOut);

	System.out.println(read.getActionSequenceString());
	System.out.println(read.getState(0).toString());
	System.out.println(read.actionSequence.size());
	System.out.println(read.stateSequence.size());

}
 
开发者ID:f-leno,项目名称:DOO-Q_BRACIS2016,代码行数:23,代码来源:EpisodeAnalysis.java

示例3: main

import burlap.behavior.policy.RandomPolicy; //导入依赖的package包/类
public static void main(String[] args) {
	GridWorldDomain gwd = new GridWorldDomain(11, 11);
	SADomain domain = gwd.generateDomain();
	State s = new GridWorldState(new GridAgent(1, 3));

	Policy p = new RandomPolicy(domain);
	Episode ea = PolicyUtils.rollout(p, s, domain.getModel(), 30);

	String yamlOut = ea.serialize();

	System.out.println(yamlOut);

	System.out.println("\n\n");

	Episode read = Episode.parseEpisode(yamlOut);

	System.out.println(read.actionString());
	System.out.println(read.state(0).toString());
	System.out.println(read.actionSequence.size());
	System.out.println(read.stateSequence.size());

}
 
开发者ID:jmacglashan,项目名称:burlap,代码行数:23,代码来源:Episode.java


注:本文中的burlap.behavior.policy.RandomPolicy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。