2017-01-24 21 views
0

https://classroom.udacity.com/courses/ud600/lessons/3780788560/concepts/40374085350923如何在Burlap中创建图形域的初始状态节点?

在以上的链接是指,为了创建一个图形域的初始状态执行该命令: GraphDefinedDomain.getState(域,0)

但是的getState确实不作为当前Burlap库的静态方法存在

那么如何创建Burlap中图形域的初始状态节点(http://burlap.cs.brown.edu/)?

(什么是我所看到的版本,Burlac有多少从那时起变化,我在哪里可以找到一个迁移指南?也可能有所帮助)

回答

0

我有同样的问题。经过一些研究后,我发现类GraphStateNode,似乎工作。

见的代码看起来像下面的示例:

public FirstMDP(double p1, double p2, double p3, double p4) { 
    this.numStates = 6; 
    this.dg = new GraphDefinedDomain(numStates); 

    // actions for initial state 0 
    ((GraphDefinedDomain) this.dg).setTransition(0,0,1,1.); //action a 
    ((GraphDefinedDomain) this.dg).setTransition(0,1,2,1.); //action b 
    ((GraphDefinedDomain) this.dg).setTransition(0,2,3,1.); //action c 

    // actions for all the other states 
    ((GraphDefinedDomain) this.dg).setTransition(1,0,1,1.); //action for state 1 
    ((GraphDefinedDomain) this.dg).setTransition(2,0,4,1.); //action for state 2 
    ((GraphDefinedDomain) this.dg).setTransition(3,0,5,1.); //action for state 3 
    ((GraphDefinedDomain) this.dg).setTransition(4,0,2,1.); //action for state 4 
    ((GraphDefinedDomain) this.dg).setTransition(5,0,5,1.); //action for state 5  

    this.domain = this.dg.generateDomain(); 
    this.initState = new GraphStateNode(); // Initial state is created 
    ((GraphStateNode) this.initState).setId(0); // Initial state is initialized 
    this.rf = new FourParamRF(p1,p2,p3,p4); 
    this.tf = new NullTermination(); 
    this.hashFactory = new SimpleHashableStateFactory(); 
} 

确保导入GraphStateNode类:

import burlap.domain.singleagent.graphdefined.GraphStateNode; 

请让我知道是否有帮助。

+0

我已经恢复到以前的版本(可以更多)与本教程兼容。非常感谢您的回答。这将在不久的将来有用 –