Skip to content
Snippets Groups Projects
Commit 43da2f03 authored by User's avatar User
Browse files

Merge origin/master

parents ce02ae7d 5a51eab6
No related branches found
No related tags found
No related merge requests found
File added
...@@ -9,7 +9,8 @@ import simkit.SimEntityBase; ...@@ -9,7 +9,8 @@ import simkit.SimEntityBase;
* Model two crane berths * Model two crane berths
* @author abuss@nps.edu * @author abuss@nps.edu
*/ */
public class TwoCraneBerths extends SimEntityBase { public class TwoCraneBerths extends SimEntityBase
{
/** /**
* Queue of Ships waiting to go into the berth * Queue of Ships waiting to go into the berth
...@@ -47,14 +48,15 @@ public class TwoCraneBerths extends SimEntityBase { ...@@ -47,14 +48,15 @@ public class TwoCraneBerths extends SimEntityBase {
super.reset(); super.reset();
queue.clear(); queue.clear();
berth.clear(); berth.clear();
timeInSystem = Double.NaN; timeInSystem = Double.NaN; // Not a Number
delayInQueue = Double.NaN; delayInQueue = Double.NaN; // Not a Number
} }
/** /**
* Only PropertyChangeEvents * Only PropertyChangeEvents
*/ */
public void doRun() { public void doRun()
{
firePropertyChange("queue", getQueue()); firePropertyChange("queue", getQueue());
firePropertyChange("berth", getBerth()); firePropertyChange("berth", getBerth());
firePropertyChange("timeInSystem", getTimeInSystem()); firePropertyChange("timeInSystem", getTimeInSystem());
......
...@@ -183,7 +183,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase ...@@ -183,7 +183,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
*/ */
public void doStartUnloadingOneCrane() { public void doStartUnloadingOneCrane() {
SortedSet<Ship> oldQueue = getQueue(); SortedSet<Ship> oldQueue = getQueue();
Ship ship = queue.first(); // TODO rename ship queue Ship ship = queue.first();
queue.remove(ship); queue.remove(ship);
firePropertyChange("queue", oldQueue, getQueue()); firePropertyChange("queue", oldQueue, getQueue());
...@@ -196,6 +196,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase ...@@ -196,6 +196,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
berth.add(ship); berth.add(ship);
firePropertyChange("berth", oldBerth, getBerth()); firePropertyChange("berth", oldBerth, getBerth());
// log crane operations for each ship
shipCount++; shipCount++;
if (shipCount == 1) if (shipCount == 1)
...@@ -212,7 +213,6 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase ...@@ -212,7 +213,6 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
waitDelay("EndUnloadingOneCrane", ship.getRemainingUnloadingTime(), ship); waitDelay("EndUnloadingOneCrane", ship.getRemainingUnloadingTime(), ship);
} }
/** /**
* Perform crane container unloading operations and send PDUs to report progress * Perform crane container unloading operations and send PDUs to report progress
* @param simkitTimeStamp simkit timeStamp when crane operations began * @param simkitTimeStamp simkit timeStamp when crane operations began
...@@ -324,7 +324,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase ...@@ -324,7 +324,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
/** /**
* Shutdown DIS network interfaces, enabling program termination * Shutdown DIS network interfaces, enabling program termination
*/ */
public void shutdown() public void shutdownDisChannel()
{ {
if (disChannel != null) if (disChannel != null)
{ {
......
...@@ -91,7 +91,7 @@ public class RunTwoCraneBerthsOpenDis7 ...@@ -91,7 +91,7 @@ public class RunTwoCraneBerthsOpenDis7
System.out.printf("Average delay in queue:\t\t%.4f%n", System.out.printf("Average delay in queue:\t\t%.4f%n",
delayInQueueStat.getMean()); delayInQueueStat.getMean());
twoCraneBerthsOpenDis7.shutdown(); twoCraneBerthsOpenDis7.shutdownDisChannel();
System.exit(0); System.exit(0);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment