Mercurial > hg > Members > nobuyasu > Consensus
diff app/models/TPGraph.java @ 35:5d422941b702
fix
author | one |
---|---|
date | Wed, 03 Oct 2012 18:43:49 +0900 |
parents | 80b5628f17d8 |
children | 5f7fcdf98380 |
line wrap: on
line diff
--- a/app/models/TPGraph.java Wed Oct 03 16:58:34 2012 +0900 +++ b/app/models/TPGraph.java Wed Oct 03 18:43:49 2012 +0900 @@ -81,21 +81,18 @@ public Edge setLabelToRootUser(UserModel user) { Vertex rootUser = getUserRootVertex(); - // rootUser ---child---> newUser return setLabel(rootUser, user.getVertex(), CHILD); } public Edge setLabelToRootClaim(ClaimModel claim) { Vertex rootClaim = getClaimRootVertex(); - // rootUser ---child---> newUser return setLabel(rootClaim, claim.getVertex(), CHILD); } public Edge setLabelToAuthor(ClaimModel claim, String author) { Vertex authorVertex = graph.getVertex(author); - // claim ---author---> authorVertex(userVertex) return setLabel(claim.getVertex(), authorVertex, NodeModel.L_AUTHOR); } @@ -125,14 +122,12 @@ public Object[] checkConsensus(HashSet<Object> set) { Iterator<Object> iter = set.iterator(); - while (iter.hasNext()) { Object childId = iter.next(); ArrayList<Object> array = getAllUpperVertex(childId); for (Object parentId: array.toArray()) { if (set.contains(parentId)) { if (set.contains(childId)) { - // This behavior is anxiety. set.remove(childId); iter = set.iterator(); @@ -150,13 +145,11 @@ GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>(); pipe.start(startV).in(NodeModel.L_QUESTION, NodeModel.L_REFUTATION, NodeModel.L_SUGGESTION); ArrayList<Object> vertexArray = new ArrayList<Object>(); - while (pipe.hasNext()) { Object e = pipe.next().getId(); vertexArray.add(e); pipe.start(graph.getVertex(e)).in(NodeModel.L_QUESTION, NodeModel.L_REFUTATION, NodeModel.L_SUGGESTION); } - return vertexArray; }