2017-01-24 29 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

我已經恢復到以前的版本(可以更多)與本教程兼容。非常感謝您的回答。這將在不久的將來有用 –