Skip to content

Commit

Permalink
Introduces CloudSim.noFutureEvents method
Browse files Browse the repository at this point in the history
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
  • Loading branch information
manoelcampos committed Mar 16, 2023
1 parent 9ad1fc6 commit 5818c38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/java/org/cloudsimplus/core/CloudSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ abstract class CloudSim implements Simulation {
/**
* The queue of events that will be sent in a future simulation time.
*/
@Getter
private final FutureQueue future;

/**
Expand Down Expand Up @@ -811,4 +810,8 @@ public long getMaxEventsNumber() {
public long getGeneratedEventsNumber() {
return future.getSerial();
}

public boolean noFutureEvents(){
return future.isEmpty();
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/cloudsimplus/core/CloudSimPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public double runFor(final double interval) {
* If some event is processed, the clock is automatically increased.*/
setClock(until);

if(getFuture().isEmpty()){
if(noFutureEvents()){
finish();
}
}
Expand Down

0 comments on commit 5818c38

Please sign in to comment.