Mercurial > hg > Members > nobuyasu > Consensus
changeset 71:c76b3b60eb18 draft
add comment
author | one |
---|---|
date | Thu, 21 Feb 2013 03:15:39 +0900 |
parents | 290a5883ac5e |
children | 1c13476a0c1f |
files | app/controllers/Claim.java app/models/TPGraph.java app/models/UserModel.java logs/application.log target/scala-2.9.1/cache/compile/compile |
diffstat | 5 files changed, 61 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/app/controllers/Claim.java Wed Feb 20 03:06:42 2013 +0900 +++ b/app/controllers/Claim.java Thu Feb 21 03:15:39 2013 +0900 @@ -154,10 +154,10 @@ String[] users = toStringArray(usersJson); tpGraph.setLabelStatusToUsers(newClaim, users, NodeModel.L_REQUEST, NodeModel.UNKNOWN); tpGraph.setLabelFromRootClaim(newClaim); - ClaimModel mentionV = new ClaimModel(graph.getVertex(id)); - tpGraph.setLabelMention(mentionV, newClaim, mentionType); + ClaimModel targetClaim = new ClaimModel(graph.getVertex(id)); + tpGraph.setLabelMention(targetClaim, newClaim, mentionType); newClaim.computeAndUpdateStatus(); - mentionV.computeAndUpdateStatus(); + targetClaim.computeAndUpdateStatus(); return created(); }
--- a/app/models/TPGraph.java Wed Feb 20 03:06:42 2013 +0900 +++ b/app/models/TPGraph.java Thu Feb 21 03:15:39 2013 +0900 @@ -167,6 +167,9 @@ return true; } + /* + * Return CLAIM numbers of top consensus vertex. + */ public Object[] checkConsensus(HashSet<Object> set) { Iterator<Object> iter = set.iterator(); iter = set.iterator(); @@ -174,21 +177,26 @@ Object childId = iter.next(); ArrayList<Object> array = getAllUpperVertex(childId); for (Object parentId: array) { + /* + * If there is a number of the number of parent and child in the [set], + * remove [childId]. + */ if (set.contains(parentId)) { if (set.contains(childId)) { + set.remove(childId); // This behavior is anxiety. - set.remove(childId); iter = set.iterator(); } childId = parentId; } } } - return set.toArray(); } - - + + /* + * Return CLAIM numbers of above [id] CLAIM. + */ public ArrayList<Object> getAllUpperVertex(Object id) { Vertex startV = graph.getVertex(id); ArrayList<Object> vertexArray = new ArrayList<Object>(); @@ -218,7 +226,6 @@ } } - public void shutdownGraph() { if (path == null) { return;
--- a/app/models/UserModel.java Wed Feb 20 03:06:42 2013 +0900 +++ b/app/models/UserModel.java Thu Feb 21 03:15:39 2013 +0900 @@ -60,5 +60,4 @@ hash.put(NodeModel.CONSENSUS, tpGraph.checkConsensus(set)); return hash; } - }
--- a/logs/application.log Wed Feb 20 03:06:42 2013 +0900 +++ b/logs/application.log Thu Feb 21 03:15:39 2013 +0900 @@ -1,12 +1,54 @@ -2013-02-05 13:31:43,624 - [INFO] - from play in main +2013-02-20 02:50:38,688 - [INFO] - from play in main Listening for HTTP on port 9000... -2013-02-05 13:31:50,592 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2013-02-20 02:51:35,779 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +Application started (Dev) + +2013-02-20 02:52:42,637 - [INFO] - from application in play-akka.actor.default-dispatcher-4 +Application shutdown... + +2013-02-20 02:52:42,658 - [INFO] - from play in play-akka.actor.default-dispatcher-4 +Application started (Dev) + +2013-02-20 02:54:52,949 - [INFO] - from application in play-akka.actor.default-dispatcher-4 +Application shutdown... + +2013-02-20 02:54:52,971 - [INFO] - from play in play-akka.actor.default-dispatcher-4 +Application started (Dev) + +2013-02-20 02:55:15,321 - [INFO] - from application in play-akka.actor.default-dispatcher-4 +Application shutdown... + +2013-02-20 02:55:15,344 - [INFO] - from play in play-akka.actor.default-dispatcher-4 Application started (Dev) -2013-02-05 15:48:11,876 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2013-02-20 02:55:32,383 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +Application shutdown... + +2013-02-20 02:55:32,403 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +Application started (Dev) + +2013-02-20 03:02:34,944 - [INFO] - from application in play-akka.actor.default-dispatcher-4 +Application shutdown... + +2013-02-20 03:02:34,975 - [INFO] - from play in play-akka.actor.default-dispatcher-4 +Application started (Dev) + +2013-02-20 03:02:45,717 - [INFO] - from application in play-akka.actor.default-dispatcher-4 Application shutdown... -2013-02-05 15:48:11,914 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2013-02-20 03:02:45,738 - [INFO] - from play in play-akka.actor.default-dispatcher-4 Application started (Dev) +2013-02-20 03:03:07,563 - [INFO] - from application in play-akka.actor.default-dispatcher-4 +Application shutdown... + +2013-02-20 03:03:07,586 - [INFO] - from play in play-akka.actor.default-dispatcher-4 +Application started (Dev) + +2013-02-21 02:40:12,217 - [INFO] - from application in play-akka.actor.default-dispatcher-5 +Application shutdown... + +2013-02-21 02:40:12,271 - [INFO] - from play in play-akka.actor.default-dispatcher-5 +Application started (Dev) +