Last change
on this file was 127, checked in by Wouter Pasman, 6 years ago |
#41 ROLL BACK of rev.126 . So this version is equal to rev. 125
|
File size:
1.3 KB
|
Rev | Line | |
---|
[127] | 1 | package agents.anac.y2015.xianfa;
|
---|
| 2 |
|
---|
| 3 | import java.util.ArrayList;
|
---|
| 4 |
|
---|
| 5 | import genius.core.issue.Value;
|
---|
| 6 |
|
---|
| 7 | public class Node {
|
---|
| 8 |
|
---|
| 9 | private Node parent;
|
---|
| 10 | private ArrayList<Node> child = new ArrayList<Node>();
|
---|
| 11 | private int depth;
|
---|
| 12 | private int number;
|
---|
| 13 | private Value value;
|
---|
| 14 | private double evaluation;
|
---|
| 15 | private boolean visited = false;
|
---|
| 16 |
|
---|
| 17 | public boolean isVisited() {
|
---|
| 18 | return visited;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | public void setVisited(boolean visited) {
|
---|
| 22 | this.visited = visited;
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public Node() {
|
---|
| 26 |
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | public Node(int number, Value value, int depth, double evaluation) {
|
---|
| 30 | this.number = number;
|
---|
| 31 | this.depth = depth;
|
---|
| 32 | this.value = value;
|
---|
| 33 | this.evaluation = evaluation;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | public void add(Node node) {
|
---|
| 37 | child.add(node);
|
---|
| 38 | node.setParent(this);
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | public Node getParent() {
|
---|
| 42 | return parent;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public ArrayList<Node> getChild() {
|
---|
| 46 | return child;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | public int getDepth() {
|
---|
| 50 | return depth;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | public int getNumber() {
|
---|
| 54 | return number;
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | public Value getValue() {
|
---|
| 58 | return value;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | public double getEvaluation() {
|
---|
| 62 | return evaluation;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | public void setParent(Node node) {
|
---|
| 66 | parent = node;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | public void show() {
|
---|
| 70 | System.out.println("this is " + number + " & " + depth + " & " + value + " & " + evaluation);
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.