當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。