如何在粗麻布中创建图域的初始状态节点?

How could you create the initial state node of a graph domain in Burlap?

https://classroom.udacity.com/courses/ud600/lessons/3780788560/concepts/40374085350923

在上面 link 它指的是为了创建图形域的初始状态,您执行此命令: GraphDefinedDomain.getState(域,0)

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

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

(我看到的是什么版本,从那时起 Burlac 发生了多少变化,我在哪里可以找到迁移指南?也可以提供帮助)

我遇到了同样的问题。经过一番研究后,我发现 class 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 class:

import burlap.domain.singleagent.graphdefined.GraphStateNode;

请告诉我是否有帮助。