本文整理汇总了Java中burlap.behavior.singleagent.learning.experiencereplay.ExperienceMemory类的典型用法代码示例。如果您正苦于以下问题:Java ExperienceMemory类的具体用法?Java ExperienceMemory怎么用?Java ExperienceMemory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExperienceMemory类属于burlap.behavior.singleagent.learning.experiencereplay包,在下文中一共展示了ExperienceMemory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readExperienceMemory
import burlap.behavior.singleagent.learning.experiencereplay.ExperienceMemory; //导入依赖的package包/类
private static ExperienceMemory readExperienceMemory(double discountFactor, final Path container) {
List<Episode> episodes = Episode.readEpisodes(container.resolve("data").toAbsolutePath().toString());
ExperienceMemory memory = new FixedSizeMemory(episodes.size()*243);
for(Episode e : episodes)
for(int t=0; t<e.maxTimeStep(); t++)
memory.addExperience(new EnvironmentOptionOutcome(e.state(t),
e.action(t),
e.state(t+1),
e.reward(t+1),
t+1==e.maxTimeStep(),
discountFactor,
e
));
return memory;
}
示例2: DeepQTester
import burlap.behavior.singleagent.learning.experiencereplay.ExperienceMemory; //导入依赖的package包/类
public DeepQTester(Policy policy, ExperienceMemory memory, StateMapping stateMapping) {
this.policy = policy;
this.memory = memory;
this.stateMapping = stateMapping;
}
示例3: setExperienceReplay
import burlap.behavior.singleagent.learning.experiencereplay.ExperienceMemory; //导入依赖的package包/类
/**
* Sets the experience replay memory to use and the number of samples to take from the memory after each step for updating
* @param memory {@link ExperienceMemory} to use
* @param numReplay the number of samples from the memory used for updating the Q-function
*/
public void setExperienceReplay(ExperienceMemory memory, int numReplay){
this.memory = memory;
this.numReplay = numReplay;
}