コード例 #1
0
    BraidNode CreateNewNode(float yValue, float layer)
    {
        Vector4 v = CreateOutput(yValue, layer);

        NormalizeOutput(v);
        Vector3       segment_vector = new Vector3(0.0f, yValue, 0.0f) + new Vector3(v.x, v.y, v.z);
        BraidNodeData data           = new BraidNodeData("ann_node_", new Vector3(0.0f, yValue, 0.0f), 1.0f, _nodeid++);
        BraidNode     b = new BraidNode(data);

        return(b);
    }
コード例 #2
0
    void Test1()
    {
        BraidNodeData data = new BraidNodeData("root", Vector3.zero, 1.5f);
        BraidNode     root = new BraidNode(data);

        data = new BraidNodeData("n1", Vector3.left, 1.0f);
        BraidNode child1 = new BraidNode(new BraidNodeData("n1", Vector3.right, 1.0f));
        BraidNode child2 = new BraidNode(new BraidNodeData("n2", Vector3.right, 1.0f));
        BraidNode child3 = new BraidNode(new BraidNodeData("n3", Vector3.right, 1.0f));

        root.children.Add(child1);
        root.children.Add(child2);
        root.children.Add(child3);

        root.PrintTree();

        JsonHelper.CreateJSONFromDataTree(root);
    }
コード例 #3
0
 public BraidNode(BraidNodeData data)
 {
     this._data = data;
     parent     = null;
     children   = new BraidNodeList(this);
 }
コード例 #4
0
 public BraidNode(BraidNodeData data, BraidNode parent)
 {
     this.data   = data;
     this.parent = parent;
     children    = new BraidNodeList(this);
 }
コード例 #5
0
 public BraidNode Add(BraidNodeData data)
 {
     return(Add(new BraidNode(data)));
 }