Revision: 97
http://gridsim.svn.sourceforge.net/gridsim/?rev=97&view=rev
Author: marcos_dias
Date: 2008-02-10 21:28:07 -0800 (Sun, 10 Feb 2008)
Log Message:
-----------
Policy updated to provide options when a reservation is rejected.
Modified Paths:
--------------
branches/gridsim4.0-branch3/examples/examples/WorkloadWithReservation.java
branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java
branches/gridsim4.0-branch3/examples/examples/workload/ar/TurboARExample01.java
branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java
Modified: branches/gridsim4.0-branch3/examples/examples/WorkloadWithReservation.java
===================================================================
--- branches/gridsim4.0-branch3/examples/examples/WorkloadWithReservation.java 2008-02-11 05:27:42 UTC (rev 96)
+++ branches/gridsim4.0-branch3/examples/examples/WorkloadWithReservation.java 2008-02-11 05:28:07 UTC (rev 97)
@@ -632,7 +632,7 @@
reservation = super.createReservation(startTime, duration, resGl.getNumPE(), resID_);
success = true;
- if(reservation == null) {
+ if(reservation == null || reservation.getStatus() == Reservation.STATUS_FAILED) {
success = false;
}
Modified: branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java
===================================================================
--- branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java 2008-02-11 05:27:42 UTC (rev 96)
+++ branches/gridsim4.0-branch3/examples/examples/ar/ARTest.java 2008-02-11 05:28:07 UTC (rev 97)
@@ -205,7 +205,7 @@
boolean success = false;
reservation = super.createReservation(time, duration, totalPE, resID);
- if(reservation != null) {
+ if(reservation != null && reservation.getStatus() != Reservation.STATUS_FAILED) {
System.out.println(super.get_name() + ": reservation has been accepted by "+
resName + " at time = " + GridSim.clock());
success = true;
Modified: branches/gridsim4.0-branch3/examples/examples/workload/ar/TurboARExample01.java
===================================================================
--- branches/gridsim4.0-branch3/examples/examples/workload/ar/TurboARExample01.java 2008-02-11 05:27:42 UTC (rev 96)
+++ branches/gridsim4.0-branch3/examples/examples/workload/ar/TurboARExample01.java 2008-02-11 05:28:07 UTC (rev 97)
@@ -89,10 +89,10 @@
//////////////////////////////////////////
// Starts the simulation in debug mode
- GridSim.startGridSimulation(true);
+// GridSim.startGridSimulation(true);
// Start the simulation in normal mode
-// GridSim.startGridSimulation();
+ GridSim.startGridSimulation();
//////////////////////////////////////////
// Final step: Prints the Gridlets when simulation is over
Modified: branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java
===================================================================
--- branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java 2008-02-11 05:27:42 UTC (rev 96)
+++ branches/gridsim4.0-branch3/examples/examples/workload/parallel/LublinWorkloadExample01.java 2008-02-11 05:28:07 UTC (rev 97)
@@ -92,10 +92,10 @@
//////////////////////////////////////////
// Starts the simulation in debug mode
-// GridSim.startGridSimulation(true);
+ GridSim.startGridSimulation(true);
// Start the simulation in normal mode
- GridSim.startGridSimulation();
+// GridSim.startGridSimulation();
//////////////////////////////////////////
// Final step: Prints the Gridlets when simulation is over
@@ -148,7 +148,7 @@
TResourceCharacteristics resConfig = new TResourceCharacteristics(
arch, os, mList, TResourceCharacteristics.CB_PARALLEL_SPACE_SHARED,
time_zone, cost);
-
+
//////////////////////////////////////////
// 6. Finally, we need to create a GridResource object.
double baud_rate = 10000.0; // communication speed
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|