Skip to content

Commit

Permalink
Assignment 4 schedule and aggregation of order #12
Browse files Browse the repository at this point in the history
Hot fix for sync issues between scheduler and orderprocessing
  • Loading branch information
Dr4gonbl4de committed Nov 25, 2018
1 parent 2da0edc commit 51db03c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/team_pjt/agents/OrderProcessing.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,19 @@ public void action() {
}
break;
case 2:
System.out.println("in case 3");
distributeScheduledOrder();
break;
}
}

@Override
public boolean done() {
boolean isDone = step >= 3 || messageCounter == allCustomers.length;
boolean isDone = messageCounter == allCustomers.length;
if(isDone) {
myAgent.addBehaviour(new schedulerSyncing());
}
isDone = isDone || step >= 3;
if(isDone) {
myAgent.addBehaviour(new OfferRequestServer());
finished();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/team_pjt/agents/SchedulerAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void action() {
ACLMessage newOrder = myAgent.receive(mtNewOrder);
if(newOrder != null) {
if(newOrder.getContent().toUpperCase().equals("NO NEW ORDER")) {
// System.out.println(myAgent.getName() + " called finished()");
System.out.println(myAgent.getName() + " called finished()");
finished();
}
else {
Expand Down

0 comments on commit 51db03c

Please sign in to comment.