annotate app/models/TPGraph.java @ 71:c76b3b60eb18 draft

add comment
author one
date Thu, 21 Feb 2013 03:15:39 +0900
parents 290a5883ac5e
children c5ddd2cc52e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
1 package models;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
2
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
3 import java.util.ArrayList;
23
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
4 import java.util.HashSet;
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
5 import java.util.Iterator;
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
6
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
7 import com.tinkerpop.blueprints.Edge;
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
8 import com.tinkerpop.blueprints.Graph;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
9 import com.tinkerpop.blueprints.Vertex;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
10 import com.tinkerpop.blueprints.impls.tg.TinkerGraph;
24
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
11 import com.tinkerpop.gremlin.java.GremlinPipeline;
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
12
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
13 public class TPGraph {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
14
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
15 private static TPGraph instance = new TPGraph();
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
16 private Object claimRootId;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
17 private Object userRootId;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
18
13
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
19 /*
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
20 * Edge type
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
21 */
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
22 protected final String CHILD = "child";
57
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
23
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
24 private TPGraph() {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
25
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
26 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
27
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
28 public static TPGraph getInstance() {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
29 return instance;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
30 }
61
0268b4239da1 modified initialData method
one
parents: 57
diff changeset
31
0268b4239da1 modified initialData method
one
parents: 57
diff changeset
32 public static void resetInstance() {
0268b4239da1 modified initialData method
one
parents: 57
diff changeset
33 instance = new TPGraph();
0268b4239da1 modified initialData method
one
parents: 57
diff changeset
34 }
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
35
52
f3db6edc61ad modify checkUnanimously
one
parents: 50
diff changeset
36 private Graph graph = null;
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
37 private String path = null;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
38
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
39 public void setPath(String path) {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
40 this.path = path;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
41 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
42
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
43 public Graph newGraph() {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
44 if (path == null) {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
45 graph = new TinkerGraph();
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
46 } else {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
47 graph = new TinkerGraph(path);
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
48
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
49 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
50 return graph;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
51 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
52
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
53 public Graph getGraph() {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
54 return graph;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
55 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
56
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
57 public void setClaimRootId(Object id) {
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
58 this.claimRootId = id;
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
59 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
60
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
61 public void setUserRootId(Object id) {
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
62 this.userRootId = id;
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
63 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
64
13
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
65 public Object getClaimRootId() {
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
66 return claimRootId;
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
67 }
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
68
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
69 public Object getUserRootId() {
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
70 return userRootId;
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
71 }
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
72
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
73 public Vertex getClaimRootVertex() {
13
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
74 return graph.getVertex(claimRootId);
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
75 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
76
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
77 public Vertex getUserRootVertex() {
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
78 return graph.getVertex(userRootId);
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
79 }
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
80
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
81 private Edge setLabel(Vertex fromV, Vertex toV, String label) {
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
82 return graph.addEdge(null, fromV, toV, label);
18
one
parents: 17
diff changeset
83 }
one
parents: 17
diff changeset
84
70
290a5883ac5e add TIMESTAMP. modified getClaimInfoTraverse.
one
parents: 61
diff changeset
85 public Edge setLabelFromRootUser(UserModel user) {
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
86 Vertex rootUser = getUserRootVertex();
18
one
parents: 17
diff changeset
87 // rootUser ---child---> newUser
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
88 return setLabel(rootUser, user.getVertex(), CHILD);
13
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
89 }
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
90
70
290a5883ac5e add TIMESTAMP. modified getClaimInfoTraverse.
one
parents: 61
diff changeset
91 public Edge setLabelFromRootClaim(ClaimModel claim) {
13
9b677755cb93 create action Claim/createClaim
one
parents: 9
diff changeset
92 Vertex rootClaim = getClaimRootVertex();
18
one
parents: 17
diff changeset
93 // rootUser ---child---> newUser
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
94 return setLabel(rootClaim, claim.getVertex(), CHILD);
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
95 }
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
96
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
97 public Edge setLabelToAuthor(ClaimModel claim, String author) {
16
7cdc9d19834f modified createClaim
one
parents: 13
diff changeset
98 Vertex authorVertex = graph.getVertex(author);
18
one
parents: 17
diff changeset
99 // claim ---author---> authorVertex(userVertex)
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
100 return setLabel(claim.getVertex(), authorVertex, NodeModel.L_AUTHOR);
16
7cdc9d19834f modified createClaim
one
parents: 13
diff changeset
101 }
7cdc9d19834f modified createClaim
one
parents: 13
diff changeset
102
20
34ea98c5a18c modified UserModel/getEdgeInUser
one
parents: 18
diff changeset
103 public Boolean setLabelToUsers(ClaimModel claim, String[] users, String label) {
18
one
parents: 17
diff changeset
104 for (String userName: users) {
one
parents: 17
diff changeset
105 Vertex userVertex = graph.getVertex(userName);
57
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
106 if (userVertex == null) {
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
107 return false;
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
108 }
20
34ea98c5a18c modified UserModel/getEdgeInUser
one
parents: 18
diff changeset
109 setLabel(claim.getVertex(), userVertex, label);
18
one
parents: 17
diff changeset
110 }
one
parents: 17
diff changeset
111 return true;
16
7cdc9d19834f modified createClaim
one
parents: 13
diff changeset
112 }
9
d050b7fb4cda create getUserRequests action
one
parents: 8
diff changeset
113
36
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
114 public Boolean setLabelStatusToUser(ClaimModel claim, String userName, String label, String status) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
115 Vertex userVertex = graph.getVertex(userName);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
116 if (userVertex == null) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
117 return false;
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
118 }
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
119 Edge edge = setLabel(claim.getVertex(), userVertex, label);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
120 edge.setProperty(NodeModel.STATUS, status);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
121 return true;
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
122 }
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
123
30
80b5628f17d8 modified ClaimModel/getInfo action
one
parents: 27
diff changeset
124 public Boolean setLabelStatusToUsers(ClaimModel claim, String[] users, String label, String status) {
80b5628f17d8 modified ClaimModel/getInfo action
one
parents: 27
diff changeset
125 for (String userName: users) {
36
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
126 Boolean createFlag = setLabelStatusToUser(claim, userName, label, status);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
127 if (!createFlag) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
128 return false;
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
129 }
30
80b5628f17d8 modified ClaimModel/getInfo action
one
parents: 27
diff changeset
130 }
80b5628f17d8 modified ClaimModel/getInfo action
one
parents: 27
diff changeset
131 return true;
80b5628f17d8 modified ClaimModel/getInfo action
one
parents: 27
diff changeset
132 }
80b5628f17d8 modified ClaimModel/getInfo action
one
parents: 27
diff changeset
133
25
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
134 public Edge setLabelMention(ClaimModel fromClaim, ClaimModel toClaim, String label) {
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
135 return setLabel(fromClaim.getVertex(), toClaim.getVertex(), label);
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
136 }
97b249d9fad1 fix infinite loop on getConsensus Action
one
parents: 24
diff changeset
137
40
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
138 public Object[] searchAllUser() {
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
139 Vertex userRootVertex = graph.getVertex(getUserRootId());
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
140 GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>();
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
141 pipe.start(userRootVertex).out(CHILD);
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
142 ArrayList<Object> userArray = new ArrayList<Object>();
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
143 for (Vertex userVertex : pipe) {
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
144 userArray.add(userVertex.getId());
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
145 }
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
146 if (userArray.size() == 0) {
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
147 return null;
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
148 }
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
149 return userArray.toArray();
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
150 }
1d5c086e069b create getAllUsers() action.
one
parents: 36
diff changeset
151
36
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
152 public Boolean deleteRequestEdge(ClaimModel claim, HashSet<Object> userSet) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
153 GremlinPipeline<Vertex,Edge> pipeEdge = new GremlinPipeline<Vertex,Edge>();
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
154 pipeEdge.start(claim.getVertex()).outE(NodeModel.L_REQUEST);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
155 ArrayList<Edge> deleteEdgeArray = new ArrayList<Edge>();
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
156 for (Edge e : pipeEdge) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
157 GremlinPipeline<Edge,Vertex> pipeUserVertex = new GremlinPipeline<Edge,Vertex>();
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
158 pipeUserVertex.start(e).inV();
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
159 Vertex userVertex = pipeUserVertex.next();
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
160 if (userSet.contains(userVertex.getId())) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
161 deleteEdgeArray.add(e);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
162 }
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
163 }
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
164 for (Edge e : deleteEdgeArray) {
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
165 graph.removeEdge(e);
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
166 }
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
167 return true;
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
168 }
5f7fcdf98380 create editClaim
one
parents: 35
diff changeset
169
71
c76b3b60eb18 add comment
one
parents: 70
diff changeset
170 /*
c76b3b60eb18 add comment
one
parents: 70
diff changeset
171 * Return CLAIM numbers of top consensus vertex.
c76b3b60eb18 add comment
one
parents: 70
diff changeset
172 */
23
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
173 public Object[] checkConsensus(HashSet<Object> set) {
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
174 Iterator<Object> iter = set.iterator();
57
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
175 iter = set.iterator();
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
176 while (iter.hasNext()) {
24
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
177 Object childId = iter.next();
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
178 ArrayList<Object> array = getAllUpperVertex(childId);
50
d6c623e92837 modified routes
one
parents: 40
diff changeset
179 for (Object parentId: array) {
71
c76b3b60eb18 add comment
one
parents: 70
diff changeset
180 /*
c76b3b60eb18 add comment
one
parents: 70
diff changeset
181 * If there is a number of the number of parent and child in the [set],
c76b3b60eb18 add comment
one
parents: 70
diff changeset
182 * remove [childId].
c76b3b60eb18 add comment
one
parents: 70
diff changeset
183 */
24
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
184 if (set.contains(parentId)) {
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
185 if (set.contains(childId)) {
71
c76b3b60eb18 add comment
one
parents: 70
diff changeset
186 set.remove(childId);
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
187 // This behavior is anxiety.
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
188 iter = set.iterator();
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
189 }
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
190 childId = parentId;
24
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
191 }
23
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
192 }
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
193 }
24
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
194 return set.toArray();
23
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
195 }
71
c76b3b60eb18 add comment
one
parents: 70
diff changeset
196
c76b3b60eb18 add comment
one
parents: 70
diff changeset
197 /*
c76b3b60eb18 add comment
one
parents: 70
diff changeset
198 * Return CLAIM numbers of above [id] CLAIM.
c76b3b60eb18 add comment
one
parents: 70
diff changeset
199 */
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
200 public ArrayList<Object> getAllUpperVertex(Object id) {
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
201 Vertex startV = graph.getVertex(id);
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
202 ArrayList<Object> vertexArray = new ArrayList<Object>();
57
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
203 while (true) {
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
204 GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>();
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
205 pipe.start(startV).in(NodeModel.L_QUESTION, NodeModel.L_REFUTATION, NodeModel.L_SUGGESTION);
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
206 if (pipe.hasNext()) {
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
207 Vertex e = pipe.next();
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
208 vertexArray.add(e.getId());
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
209 startV = e;
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
210 } else {
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
211 break;
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
212 }
27
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
213 }
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
214 return vertexArray;
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
215 }
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
216
e246e0dac9c8 modified checkConsensus
one
parents: 26
diff changeset
217 public Object getOneUpperVertex(Object id) {
24
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
218 Vertex startV = graph.getVertex(id);
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
219 GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>();
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
220 pipe.start(startV).in(NodeModel.L_QUESTION, NodeModel.L_REFUTATION, NodeModel.L_SUGGESTION);
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
221 if (pipe.hasNext()) {
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
222 Vertex v = pipe.next();
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
223 return v.getId();
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
224 } else {
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
225 return null;
81d1d7c7bcde create getConsensus action. but this action can not test because there is no createMention action.
one
parents: 23
diff changeset
226 }
23
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
227 }
cad8e054fe4b modifying getConsensus action
one
parents: 20
diff changeset
228
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
229 public void shutdownGraph() {
57
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
230 if (path == null) {
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
231 return;
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
232 } else {
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
233 graph.shutdown();
ed77c5258568 modify getAllUpperClaims
one
parents: 52
diff changeset
234 }
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
235 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
236
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
237 }