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;
* Model two crane berths
* @author abuss@nps.edu
*/
public class TwoCraneBerths extends SimEntityBase {
public class TwoCraneBerths extends SimEntityBase
{
/**
* Queue of Ships waiting to go into the berth
......@@ -47,14 +48,15 @@ public class TwoCraneBerths extends SimEntityBase {
super.reset();
queue.clear();
berth.clear();
timeInSystem = Double.NaN;
delayInQueue = Double.NaN;
timeInSystem = Double.NaN; // Not a Number
delayInQueue = Double.NaN; // Not a Number
}
/**
* Only PropertyChangeEvents
*/
public void doRun() {
public void doRun()
{
firePropertyChange("queue", getQueue());
firePropertyChange("berth", getBerth());
firePropertyChange("timeInSystem", getTimeInSystem());
......
......@@ -183,7 +183,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
*/
public void doStartUnloadingOneCrane() {
SortedSet<Ship> oldQueue = getQueue();
Ship ship = queue.first(); // TODO rename ship queue
Ship ship = queue.first();
queue.remove(ship);
firePropertyChange("queue", oldQueue, getQueue());
......@@ -196,6 +196,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
berth.add(ship);
firePropertyChange("berth", oldBerth, getBerth());
// log crane operations for each ship
shipCount++;
if (shipCount == 1)
......@@ -212,7 +213,6 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
waitDelay("EndUnloadingOneCrane", ship.getRemainingUnloadingTime(), ship);
}
/**
* Perform crane container unloading operations and send PDUs to report progress
* @param simkitTimeStamp simkit timeStamp when crane operations began
......@@ -324,7 +324,7 @@ public class TwoCraneBerthsOpenDis7 extends SimEntityBase
/**
* Shutdown DIS network interfaces, enabling program termination
*/
public void shutdown()
public void shutdownDisChannel()
{
if (disChannel != null)
{
......
......@@ -91,7 +91,7 @@ public class RunTwoCraneBerthsOpenDis7
System.out.printf("Average delay in queue:\t\t%.4f%n",
delayInQueueStat.getMean());
twoCraneBerthsOpenDis7.shutdown();
twoCraneBerthsOpenDis7.shutdownDisChannel();
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