本文整理汇总了Java中burlap.behavior.singleagent.planning.stochastic.sparsesampling.SparseSampling.HashedHeightState方法的典型用法代码示例。如果您正苦于以下问题:Java SparseSampling.HashedHeightState方法的具体用法?Java SparseSampling.HashedHeightState怎么用?Java SparseSampling.HashedHeightState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类burlap.behavior.singleagent.planning.stochastic.sparsesampling.SparseSampling
的用法示例。
在下文中一共展示了SparseSampling.HashedHeightState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DifferentiableSparseSampling
import burlap.behavior.singleagent.planning.stochastic.sparsesampling.SparseSampling; //导入方法依赖的package包/类
/**
* Initializes. The model of this planner will automatically be set to a {@link CustomRewardModel} using the provided reward function.
* @param domain the problem domain
* @param rf the differentiable reward function
* @param gamma the discount factor
* @param hashingFactory the hashing factory used to compare state equality
* @param h the planning horizon
* @param c how many samples from the transition dynamics to use. Set to -1 to use the full (unsampled) transition dynamics.
* @param boltzBeta the Boltzmann beta parameter for the differentiable Boltzmann (softmax) backup equation. The larger the value the more deterministic, the closer to 1 the softer.
*/
public DifferentiableSparseSampling(SADomain domain, DifferentiableRF rf, double gamma, HashableStateFactory hashingFactory, int h, int c, double boltzBeta){
this.solverInit(domain, gamma, hashingFactory);
this.h = h;
this.c = c;
this.rf = rf;
this.boltzBeta = boltzBeta;
this.nodesByHeight = new HashMap<SparseSampling.HashedHeightState, DiffStateNode>();
this.rootLevelQValues = new HashMap<HashableState, DifferentiableSparseSampling.QAndQGradient>();
this.rfDim = rf.numParameters();
this.vinit = new VanillaDiffVinit(new ConstantValueFunction(), rf);
this.model = new CustomRewardModel(domain.getModel(), rf);
this.operator = new DifferentiableSoftmaxOperator(boltzBeta);
this.debugCode = 6368290;
}
示例2: DifferentiableSparseSampling
import burlap.behavior.singleagent.planning.stochastic.sparsesampling.SparseSampling; //导入方法依赖的package包/类
/**
* Initializes.
* @param domain the problem domain
* @param rf the differentiable reward function
* @param tf the terminal function
* @param gamma the discount factor
* @param hashingFactory the hashing factory used to compare state equality
* @param h the planning horizon
* @param c how many samples from the transition dynamics to use. Set to -1 to use the full (unsampled) transition dynamics.
* @param boltzBeta the Boltzmann beta parameter for the differentiable Boltzmann (softmax) backup equation. The larger the value the more deterministic, the closer to 1 the softer.
*/
public DifferentiableSparseSampling(Domain domain, DifferentiableRF rf, TerminalFunction tf, double gamma, HashableStateFactory hashingFactory, int h, int c, double boltzBeta){
this.solverInit(domain, rf, tf, gamma, hashingFactory);
this.h = h;
this.c = c;
this.boltzBeta = boltzBeta;
this.nodesByHeight = new HashMap<SparseSampling.HashedHeightState, DiffStateNode>();
this.rootLevelQValues = new HashMap<HashableState, DifferentiableSparseSampling.QAndQGradient>();
this.rfDim = rf.getParameterDimension();
this.vinit = new VanillaDiffVinit(new ValueFunctionInitialization.ConstantValueFunctionInitialization(), rf);
this.debugCode = 6368290;
}
示例3: getStateNode
import burlap.behavior.singleagent.planning.stochastic.sparsesampling.SparseSampling; //导入方法依赖的package包/类
/**
* Either returns, or creates, indexes, and returns, the state node for the given state at the given height in the tree
* @param s the state
* @param height the height (distance from leaf node) of the node.
* @return the state node for the given state at the given height in the tree
*/
protected DiffStateNode getStateNode(State s, int height){
HashableState sh = this.hashingFactory.hashState(s);
SparseSampling.HashedHeightState hhs = new SparseSampling.HashedHeightState(sh, height);
DiffStateNode sn = this.nodesByHeight.get(hhs);
if(sn == null){
sn = new DiffStateNode(sh, height);
this.nodesByHeight.put(hhs, sn);
}
return sn;
}