Placeholder

CMSC 335 Project 4 SeaPort

$7.99

Description

Introduction – the SeaPort Project series
For this set of project, we wish to simulate some of the aspects of a number of Sea Ports.
Here are the classes and their instance variables we wish to define:
SeaPortProgram extends JFrame
variables used by the GUI interface
world: World
Thing implement Comparable
index: int
name: String
parent: int
World extends Thing
ports: ArrayList
time: PortTime
SeaPort extends Thing
docks: ArrayList
que: ArrayList // the list of ships waiting to
dock
ships: ArrayList // a list of all the ships at
this port
persons: ArrayList // people with skills at
this port
Dock extends Thing
ship: Ship
Ship extends Thing
arrivalTime, dockTime: PortTime
draft, length, weight, width: double
jobs: ArrayList
PassengerShip extends Ship
numberOfOccupiedRooms: int
numberOfPassengers: int
numberOfRooms: int
CargoShip extends Ship
cargoValue: double
cargoVolume: double
cargoWeight: double
Person extends Thing
skill: String
Job extends Thing – optional till Projects 3 and 4
duration: double
requirements: ArrayList
// should be some of the skills of the persons
PortTime
time: int
Eventually, in Projects 3 and 4, you will be asked to show the progress of the jobs using JProgressBar’s.
Here’s a very quick overview of the projects:
Read a data file, create the internal data structure, create a GUI to display the structure, and let the user search the structure.
Sort the structure, use hash maps to create the structure more efficiently.
Create a thread for each job, cannot run until ship has a dock, create a GUI to show the progress of each job.
Simulate competing for resources (persons with particular skills) for each job.
General Objectives
Here are some notes about the projects, the particular features of object-oriented design and object-oriented programming (OOD/OOP) the we want to cover in this class and some of the features of Java to help support that style of programming. We also want to explore the Java GUI system a little, with particular emphasis on viewing the data structures and effective ways to display the running of multiple threads competing for resources.
The particular scenarios selected for each semester ask you to implement as many of these objectives as possible in some compelling way. We are always open to additions and suggestions.
Project 4 General Objectives
Project 4 – Concurrency
Resource pools o Threads competing for multiple resources
Blocking threads
Extending the GUI interface to visualize the resource pools and progress of the various threads.
Documentation Requirements:
You should start working on a documentation file before you do anything else with these projects, and fill in items as you go along. Leaving the documentation until the project is finished is not a good idea for any number of reasons.
The documentation should include the following (graded) elements:
Cover page (including name, date, project, your class information)
Design
including a UML class diagram
classes, variables and methods: what they mean and why they are there
tied to the requirements of the project
User’s Guide
how would a user start and run your project
any special features
effective screen shots are welcome, but don’t overdo this
Test Plan
do this BEFORE you code anything
what do you EXPECT the project to do
justification for various data files, for example
Lessons Learned o express yourself here o a way to keep good memories of successes after hard work
Project 4 Specific Goals:
Extend project 3 to include making jobs wait until people with the resources required by the job are available at the port.
Elaboration:
Reading Job specifications from a data file and adding the required resources to each Job instance.
Resource pools – SeaPort.ArrayList list of persons with particular skills at each port, treated as resource pools, along with supporting assignment to ships and jobs.
Job threads – using the resource pools and supporting the concept of blocking until required resources are available before proceeding.
The Job threads should be efficient:
If the ship is at a dock and all the people with required skills are available, the job should start.
Otherwise, the Job should not hold any resources if it cannot progress.
Use synchronization to avoid race conditions.
Each Job thread should hold any required synchronization locks for a very short period.
When a job is over, all the resources used by the job (the people) should be released back to the port.
When all the jobs of a ship are done, the ship should depart the dock and if there are any ships in the port que, one of then should should be assigned to the free dock, and that ships jobs can now try to progress.
NOTE: If a job can never progress because the port doesn’t have enough skills among all the persons at the port, the program should report this and cancel the job.
GUI showing:
Resources in pools – how many people with skill are currently available
Thread progress, resources acquired, and resources requests still outstanding
SCREENSHOTS
SOLUTION
PAYMENT
The solution includes a Netbeans project and full java source code.
Attachments [Move over files to preview content of those files]
CMSC_335_Project_4.zip (1.15 MB)
Netbeans Project
CMSC_335_Project_4
.gitignore
aSPaa.txt
aSPab.txt
aSPac.txt
aSPad.txt
aSPae.txt
build
built-jar.properties
classes
SeaPortPackage
CargoShip.class
DataLoader.class
Debug.class
Dock.class
GameLoader.class
Job.class
Maps.class
PassengerShip.class
Person.class
PortTime.class
SeaPort.class
SeaPortProgram.class
Ship.class
SkillsMap.class
SkillsSemaphore.class
TestProgram.class
Thing.class
VariableBuilder.class
World.class
empty
generated-sources
ap-source-output
build.xml
manifest.mf
master-application.jnlp
nbproject
build-impl.xml
configs
JWS_generated.properties
genfiles.properties
jnlp-impl.xml
jnlp-impl_backup.xml
private
private.properties
private.xml
project.properties
project.xml
preview-application.html
Projects_UML.vpp
Projects_UML.vux
src
SeaPortPackage
CargoShip.java
DataLoader.java
Debug.java
Dock.java
GameLoader.java
Job.java
Maps.java
PassengerShip.java
Person.java
PortTime.java
SeaPort.java
SeaPortProgram.java
Ship.java
SkillsMap.java
SkillsSemaphore.java
TestProgram.java
Thing.java
VariableBuilder.java
World.java
test
SeaPortPackage
CargoShipTest.java
DataLoaderTest.java
DebugTest.java
DockTest.java
GameLoaderTest.java
JobTest.java
MapsTest.java
PassengerShipTest.java
PersonTest.java
PortTimeTest.java
RootSuite.java
SeaPortPackageSuite.java
SeaPortProgramTest.java
SeaPortTest.java
ShipTest.java
SkillsMapTest.java
SkillsSemaphoreTest.java
SortMapTest.java
TestProgramTest.java
ThingTest.java
WorldTest.java
testRead.txt
testWrite.txt
Report.pdf
UML Diagram.PNG
Preview aSPaa.txt
// xxxx xxxx xxxxx xxxxxx(xxxx)
// xxxx
xxxx xxxx_4 20004 10000 30004
xxxx xxxx_0 20000 10000 30000
xxxx xxxx_1 20001 10000 30001
dock Pier_3 20003 10000 30003
dock Pier_2 20002 10000 30002

// pship name index parent(dock/port) weight length width draft numPassengers numRooms numOccupied
// pship
pship Gallinules 30000 20000 125.99 234.70 60.67 37.14 746 246 246
pship Remora 30001 20001 126.38 358.27 74.12 31.54 3768 979 979
pship Absentmindedness 30004 20004 86.74 450.43 33.13 41.67 2143 920 920
pship Preanesthetic 30003 20003 149.85 483.92 125.71 31.21 166 409 83
pship Shoetrees 30002 20002 134.41 156.96 120.31 35.20 1673 633 633

// cship name index parent(dock/port) weight length width draft cargoWeight cargoVolume cargoValue
// xxxxx
xxxxx xxxxxxxxx 40001 10000 200.80 242.33 38.31 23.49 172.73 188.54 235.57
xxxxx xxxxxxxxx 40000 10000 120.85 362.55 96.82 19.09 33.08 188.31 261.57
xxxxx xxxxxxxx 40002 10000 79.90 234.26 73.18 15.71 125.27 179.00 729.95
xxxxx xxxxxxxxx 40003 10000 219.92 443.54 104.44 34.16 86.69 139.89 813.72
xxxxx xxxxxxx 40004 10000 189.12 448.99 73.97 37.67 88.90 175.03 1002.63
Preview aSPab.txt
xxxx xxxxxxxxxx 10000 0
// xxxx xxxx xxxxx xxxxxx(xxxx)
// xxxx
xxxx xxxx_30 20030 10003 40048
dock Pier_24 20024 10003 30017
dock Pier_21 20021 10002 30014
dock Pier_31 20031 10003 40049
dock Pier_9 20009 10001 30008
dock Pier_27 20027 10003 40045
dock Pier_3 20003 10000 30003
dock Pier_33 20033 10004 30021
dock Pier_10 20010 10001 30009
dock Pier_26 20026 10003 30019
dock Pier_1 20001 10000 30001
dock Pier_8 20008 10001 30007
dock Pier_5 20005 10000 40000
xxxx xxxx_20 20020 10002 30013
xxxx xxxx_23 20023 10003 30016
xxxx xxxx_35 20035 10004 30023
xxxx xxxx_13 20013 10001 40017
xxxx xxxx_16 20016 10001 40020
xxxx xxxx_17 20017 10002 30010
Preview aSPac.txt
xxxx xxxxxxx 10007 0
xxxx xxxxxxxx 10002 0
xxxx xxxxxxx 10000 0
xxxx xxxxxx 10003 0
xxxx xxxxxxxx 10001 0
port Santiago 10005 0

// dock name index parent(port)
// dock
dock Pier_80 20080 10006 30121
dock Pier_69 20069 10004 30091
dock Pier_58 20058 10004 30080
dock Pier_44 20044 10003 30063
dock Pier_34 20034 10002 30052
dock Pier_21 20021 10001 30025
dock Pier_32 20032 10002 30050
dock Pier_51 20051 10003 30070
xxxx xxxx_87 20087 10006 30128
xxxx xxxx_60 20060 10004 30082
xxxx xxxx_91 20091 10007 30140
xxxx xxxx_81 20081 10006 30122
xxxx xxxx_31 20031 10002 30049
xxxx xxxx_40 20040 10002 30058
Preview aSPad.txt
xxxx xxxxxxxxxx 10001 0
// xxxx xxxx xxxxx xxxxxx(xxxx)
// xxxx
xxxx xxxx_5 20005 10001 30005
dock Pier_2 20002 10000 30002
dock Pier_12 20012 10002 30010
dock Pier_15 20015 10002 30013
dock Pier_17 20017 10002 40012
dock Pier_6 20006 10001 30006
dock Pier_10 20010 10001 40006
dock Pier_1 20001 10000 30001
dock Pier_13 20013 10002 30011
dock Pier_3 20003 10000 30003
dock Pier_7 20007 10001 30007
dock Pier_18 20018 10002 40013
dock Pier_4 20004 10000 30004
xxxx xxxx_9 20009 10001 30009
xxxx xxxx_14 20014 10002 30012
xxxx xxxx_0 20000 10000 30000
xxxx xxxx_16 20016 10002 30014
xxxx xxxx_11 20011 10001 40007
xxxx xxxx_8 20008 10001 30008
Preview aSPae.txt
xxxx xxxxxxx 10000 0
xxxx xxxxxxx 10005 0
xxxx xxxxx_xxxx 10003 0
xxxx xxxx_xxxx 10007 0
xxxx xxxxxxx 10002 0
port Laem_Chabang 10004 0

// dock name index parent(port)
// dock
dock Pier_67 20067 10006 30134
dock Pier_19 20019 10002 30040
dock Pier_5 20005 10000 30005
dock Pier_31 20031 10003 30063
dock Pier_15 20015 10001 30028
dock Pier_41 20041 10004 30081
dock Pier_2 20002 10000 30002
dock Pier_11 20011 10001 30024
xxxx xxxx_32 20032 10003 30064
xxxx xxxx_48 20048 10005 30103
xxxx xxxx_23 20023 10002 30044
xxxx xxxx_8 20008 10001 30021
xxxx xxxx_58 20058 10006 30125
xxxx xxxx_49 20049 10005 30104
Preview preview-application.html
&xx;!xxxxxxx xxxx xxxxxx &xxxx;-//x3x//xxx xxxx 4.01 xxxxxxxxxxxx//xx&xxxx;&xx;
&xx;xxxx&xx;
&xx;xxxx&xx;
&xx;xxxxx&xx;xxxx xxxx xxx xxxxxxxxx xxx xxxxxxxxxxx xxx xxxx&xx;/xxxxx&xx;
&xx;/xxxx&xx;

Test page for launching the application via JNLP


&xx;!–
&xx;x xxxx=&xxxx;${xxxx.xxxx}&xxxx;&xx;xxxxxx xxx xxxxxxxxxxx&xx;/x&xx;
–&xx;
&xx;/xxxx&xx;
&xx;/xxxx&xx;
Preview CargoShip.java
xxxxxxx xxxxxx xxxxxxxxxxx;
xxxxxx xxxxxxxxx() {
xxxx(“xxxxxxxxxx 0”);
} // xxx xxxxxxx xxxxxxxxxxx
public CargoShip(String st) { this(new Scanner(st)); }
public CargoShip(Scanner sc) { super(sc); this.cargoWeight = sc.hasNextDouble() ? sc.nextDouble() : 0.0; this.cargoVolume = sc.hasNextDouble() ? sc.nextDouble() : 0.0; this.cargoValue = sc.hasNextDouble() ? sc.nextDouble() : 0.0; } // end Scanner constructor
xxxxxx xxxxxx xxxxxxxxxxxxx() {
xxxxxx xxxxxxxxxx;
}
xxxxxx xxxx xxxxxxxxxxxxx(xxxxxx xxxxxxxxxx) {
xxxx.xxxxxxxxxx = xxxxxxxxxx;
Preview DataLoader.java
xxxxxxx xxxxxxxxx
xxxx;
xxxxxx xxxxxxxxxx() {
xxxx = xxx xxxxxxxxx<>();
}
public DataLoader(String fileName) {
data = new ArrayList<>();
loadFromFile(fileName);
}
public DataLoader(File file) {
data = new ArrayList<>();
loadFromFile(file);
}
public DataLoader(Scanner sc) {
data = new ArrayList<>();
loadFromFile(sc);
}
xxxxxx xxxxxx xxxxxxx(xxx xxxxx) {
xxxxxx xxxx.xxx(xxxxx);
}
xxxxxx xxxx xxxxxxx(xxxxxx xxxxx) {
xxxx.xxx(xxxxx);
Preview Dock.java
xxxxxx xxxx() {
xxxx(“xxxxx 0”);
} // xxx xxxxxxx xxxxxxxxxxx
public Dock(String st) { this(new Scanner(st)); }
public Dock(Scanner sc) { super(sc); this.initObjects(); } // end Scanner constructor
//ensure memory allocation private void initObjects() { this.ship = null;
}
@xxxxxxxx
xxxxxx xxxxxx xxxxxxxx() {
xxxxxx “xxxx:x ” + xxxxx.xxxxxxxx();
}
Preview GameLoader.java
xxxxx();
}
xxxxxx xxxxxxxxxx(xxxx xxxx, xxxxxxx xxxxxxxxx) {
xxxxx(xxxx);
if(swapIndex) swapIndex(); }
public GameLoader(Scanner sc, boolean swapIndex) { super(sc); if(swapIndex) swapIndex(); }
public GameLoader(String st, boolean swapIndex) { super(st); if(swapIndex) swapIndex(); }
//xxxxxxxxx xxx xxxxx xxx xxxx xxxxx xxxxxx xxx xxxxxxx
//x.x 10000 xxxx xxxx xxxxxx
xxxxxxx xxxx xxxxxxxxx() {
xx(!xxxxxxx) {
xxxxxxxxx
xxxxxxx = xxx xxxxxxxxx<>();
Preview Job.java
xxxxxx xxxxx xxx xxxxxxx xxxxx xxxxxxxxxx xxxxxxxx {
@xxxxxxxxxxxxxxxx(“xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”)
xxxxxx xxxxxx xxxx.xxxxxxxxxxx xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxxxxxx xxxxx xxxxxx xxxxxxxx;
xxxxxxx xxxxxxxxx
xxxxxxxxxxxx; // xxxxxx xx xxxx xx xxx xxxxxx xx xxx xxxxxxx
private static boolean goFlag = true, killFlag = true; private JProgressBar pb; private static DefaultTableModel jobTableModel; private Ship parentShip = null;
public Job() { this(“aJob 0”); } // end default constructor
public Job(String st) { this(new Scanner(st)); }
xxxxxx xxx(xxxxxxx xx) {
xxxxx(xx);
xxxx.xxxxxxxxxxx();
xxxx.xxxxxxxx = xx.xxxxxxxxxxxxx() ? xx.xxxxxxxxxx() : 0.0;
xxxxx(xx.xxxxxxx()) //xxxx xxx xxxxx xx xxx xxxxxxxxxxxx
Preview Maps.java
xxxx, xxxxxx, //xxxxxx
xxxxxxxxxxx, xxxxxxxx, xxxxx, xxxxxx, xxxxxx, xxxxx, //xxxxx
xxxxxxxxxxxxxxxx, xxxxxxxxxxxxx, xxxxxxxx, //xxxxxxxxxxxxxx
xxxxxxxxxx, xxxxxxxxxxx, xxxxxxxxxxx, //xxxxxxxxxx
xxxxx, //xxxxxxx
DURATION, REQUIREMENT //Jobs };
//assures only compatible objects will sort, otherwise sort is not changed for parent objects public static void setSortBy(Maps.SORTOPTIONS sort) { switch(sort) { case NAME: //set all objects to sort by… Thing.sortBy = Maps.SORTOPTIONS.NAME; World.sortBy = Maps.SORTOPTIONS.NAME; SeaPort.sortBy = Maps.SORTOPTIONS.NAME; Ship.sortBy = Maps.SORTOPTIONS.NAME; PassengerShip.sortBy = Maps.SORTOPTIONS.NAME;
xxxxxxxxx.xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxxxxx.xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxx.xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxxxx;
xxxx xxxxxx: //xxx xxx xxxxxxx xx xxxx xx…
xxxxx.xxxxxx = xxxx.xxxxxxxxxxx.xxxxxx;
Preview PassengerShip.java
xxxxxxx xxx xxxxxxxxxxxxx;
xxxxxx xxxxxxxxxxxxx() {
xxxx(“xxxxxxxxxxxxxx 0”);
} // xxx xxxxxxx xxxxxxxxxxx
public PassengerShip(String st) { this(new Scanner(st)); }
public PassengerShip(Scanner sc) { super (sc); this.numberOfPassengers = sc.hasNextInt() ? sc.nextInt() : 0; this.numberOfRooms = sc.hasNextInt() ? sc.nextInt() : 0; this.numberOfOccupiedRooms = sc.hasNextInt() ? sc.nextInt() : 0; } // end Scanner constructor
@xxxxxxxx
xxxxxx xxx xxxxxxxxx(xxxxx x) {
xx(x xxxxxxxxxx xxxxxxxxxxxxx)
xxxxxx(xxxxxxxxxxxxx.xxxxxx) {
xxxx xxxxxxxxxxxxxxxx: xxxxxx (xxxx.xxxxxxxxxxxxxxxxxxxxxxxx()- ((xxxxxxxxxxxxx)x).xxxxxxxxxxxxxxxxxxxxxxxx());
xxxx xxxxxxxxxxxxx: xxxxxx (xxxx.xxxxxxxxxxxxxxxxxxxxx() – ((xxxxxxxxxxxxx)x).xxxxxxxxxxxxxxxxxxxxx());
Preview Person.java
xxxxxx xxxxxx() {
xxxx(“xxxxxxx 0”);
} // xxx xxxxxxx xxxxxxxxxxx
xxxxxx xxxxxx(xxxxxx xx) {
this(new Scanner(st)); }
public Person(Scanner sc) { super(sc); this.skill = sc.hasNext() ? sc.next() : “”; } // end Scanner constructor
public String getSkill() { return skill; }
xxxxxx xxxx xxxxxxxx(xxxxxx xxxxx) {
xxxx.xxxxx = xxxxx;
}
@xxxxxxxx
xxxxxx xxx xxxxxxxxx(xxxxx x) {
Preview PortTime.java
xxxxxxx xxxxxxxxxxxxxx;
xxxxxx xxxx.xxxx.xxxxxxx;
xxxxxx xxxxx xxxxxxxx {
private int time;
public PortTime() { this(“0”); } // end default constructor
public PortTime(String st) {
xxxx(xxx xxxxxxx(xx));
}
xxxxxx xxxxxxxx(xxxxxxx xx) {
xxxx.xxxx = xx.xxxxxxxxxx() ? xx.xxxxxxx() : 0;
} // xxx xxxxxxx xxxxxxxxxxx
Preview SeaPort.java
xxxxxx xxxxxx xxxx.xxxxxxxxxxx xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxxxxx xxxx xxxxxxxxx { xxxxx, xxx, xxxxx, xxxxxxx };
xxxxxxx xxx
xxxxx;
xxxxxxx xxxxxxxxxx
xxx; // xxx xxxx xx xxxxx xxxxxxx xx xxxx
xxxxxxx xxx
xxxxx; // x xxxx xx xxx xxx xxxxx xx xxxx xxxx
private Map
persons; // people with skills at this port protected DefaultMutableTreeNode dockNode, shipNode, personNode; private SkillsSemaphore availableSkills; //a semaphore for each skill available at this port
public SeaPort() { this(“aPort 0”); } // end default constructor
public SeaPort(String st) { this(new Scanner(st)); }
xxxxxx xxxxxxx(xxxxxxx xx) {
xxxxx(xx);
xxxx.xxxxxxxxxxx();
} // xxx xxxxxxx xxxxxxxxxxx
Preview SeaPortProgram.java
xxxxxx xxxxx.xxxxx.xxxxx.xxxxxxxxxxxxxxxxxxxxxxxx;
xxxxxx xxxxx.xxxxx.xxxxx.xxxxxxxxxxxxxxxxx;
xxxxxx xxxxx.xxxxx.xxxx.xxxxxxxxxxxxxxxxxxxxxx;
xxxxxx xxxxx.xxxxx.xxxx.xxxxxxxxxxxxxxxx;
xxxxxx xxxxx.xxxxx.xxxx.xxxxxxxx;
public class SeaPortProgram extends JFrame {
private final boolean autoSelectFile = false;
public static final long serialVersionUID = 5;
World theWorld = new World(“JesseWorld -1”);
Map
found = new HashMap<>(); //placeholder for searches

public SeaPortProgram() {
Debug.setDebugging(true);
initComponents();
initObjects();
initView();
xxxxxxxxx();
}
xxxxxxx xxxx xxxxxxxxxxx() {
xxxxx.xxxxxxxxxxx(xxxxxxx);
Preview Ship.java
@xxxxxxxxxxxxxxxx(“xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”)
xxxxxx xxxxxx xxxx.xxxxxxxxxxx xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxxxxxx xxxxxxxx xxxxxxxxxxx;
xxxxxxx xxxxxxxx xxxxxxxx;
xxxxxxx xxxxxx xxxxx;
private double length; private double weight; private double width; private Map
jobs; private static boolean jobOutputEnabled = false; protected DefaultMutableTreeNode jobNode; private Dock servicingDock = null; private boolean docked;
public Ship() { this(“aShip 0”); } // end default constructor
xxxxxx xxxx(xxxxxx xx) {
xxxx(xxx xxxxxxx(xx));
}
xxxxxx xxxx(xxxxxxx xx) {
Preview SkillsMap.java
xxxxxxx xxxxxxxxxxxxxx;
xxxxxx xxxx.xxxx.xxxxxxx;
xxxxxx xxxx.xxxx.xxx;
public final class SkillsMap { private final Map
skills = new HashMap<>();
public SkillsMap(Map
pm) { pm.values().stream().forEach((e) -> { addSkill(e.getSkill());
});
}
xxxxxx xxxx xxxxxxxx(xxxxxx xx) {
xx(!xx.xxxxxx(“”))
xx(xxxxxx.xxxxxxxxxxx(xx)) {
Preview SkillsSemaphore.java
xxxxxxx xxxxx xxx
xxxxxxxxxx; //xxxxx xxxxxxxxxx xx xxxxxxxxx
xxxxxxx xxxxx xxxxxxxxx xx; //xxx xx xxxxxx xx xxxxx xx xxxx x.x. 4 xxxxx xxxx xxxxxxx xx xxxx
xxxxxxx xxxxxxx xxxxxxxxxx = xxxx;
xxxxxxx xxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx;
public SkillsSemaphore(SkillsMap sm) { this.semaphores = new HashMap<>(); this.sm = sm; initSemaphore(); }
public Semaphore forSkill(String st) { if(semaphores.containsKey(st)) return semaphores.get(st); return new Semaphore(0,true); }
xxxxxx xxxxxxxxx xxxxxxxxxxxx() {
xxxxxx xx;
}
xxxxxxx xxxx xxxxxxxxxxxxx() {
xx.xxxxxx().xxxxxxxx().xxxxxx().xxxxxxx((x) -> {
Preview TestProgram.java
xxxxxxx xxxxxxxxxxxxxx;
xxxxxx xxxx.xx.xxxx;
xxxxxx xxxxx.xxxxx.xxxxxxxxxxxx;
xxxxxx xxxxx.xxxxx.xxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxx;
public class TestProgram { private static final World theWorld = new World(“JesseWorld -1”);
public static void main(String[] args) { //test(); //test2();
//xxx xxx xxxx xxxxxx xxxxx xxxx xx xxxx xxxx
xxxxxxxxxxxx xxxxxxxxxxxxxx = xxx xxxxxxxxxxxx(“.”);
xxxxxxxxxxxxxxxxxxxxxxx xxxxxx = xxx xxxxxxxxxxxxxxxxxxxxxxx(“xxxx xxxxx”, “xxx”);
xxxxxxxxxxxxxx.xxxxxxxxxxxxx(xxxxxx);
xxx xxxxxxxxx = xxxxxxxxxxxxxx.xxxxxxxxxxxxxx(xxxx);
Preview Thing.java
xxxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxx;
xxxxxx xxxxx() {
xxxx(“xxxxxx 0”);
} // xxx xxxxxxx xxxxxxxxxxx
public Thing(String st) { this(new Scanner(st)); }
public Thing(Scanner sc) { this.node = new DefaultMutableTreeNode(“Thing”); this.name = sc.hasNext() ? sc.next() : “aThing”; this.node.setUserObject(this.getName()); this.parent = sc.hasNextInt() ? sc.nextInt() : 0; } // end Scanner constructor
@xxxxxxxx
xxxxxx xxxxxxxxx
xxxxxxxxxxxx() {
xxxxxxxxx
xxxxxxxxx = xxx xxxxxxxxx<>();
xxxxxxxxx.xxx(“xxxx”); xxxxxxxxx.xxx(“xxxxxx”);
//xxxxxxxxx.xxxx((xxxxxx x1, xxxxxx x2)->(x1.xxxxxxxxxxxxxxxxxxx(x2)));
xxxxxx xxxxxxxxx;
Preview VariableBuilder.java
package SeaPortPackage;
import java.util.ArrayList;
public interface VariableBuilder {
xxxxxx xxxxxxxxx xxxxxxxxxxxxxxx {
xxxxxx xxxxxxxxx
xxxxxxxxxxxx();
}
Preview World.java
xxxxxx xxxxxx xxxx.xxxxxxxxxxx xxxxxx = xxxx.xxxxxxxxxxx.xxxx;
xxxxxx xxxxxx xxxx xxxxxx_xxxxx { xxxxx, xxxxxxx, xxxx, xxxx, xxxxxxxxxxxxx, xxxxxxxxx, xxxxxx, xxx };
xxxxxxx xxxxx xxx
xxxxx;
xxxxxxx xxxxxxxx xxxx;
xxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxxxxxx;
public World() { this(“aWorld -1”); } // end default constructor
public World(String st) { this(new Scanner(st)); }
public World(Scanner sc) { super(sc); this.ports = new HashMap<>();
xxxxxxxxxxx();
} // xxx xxxxxxx xxxxxxxxxxx
xxxxxxx xxxx xxxxxxxxxxx() {
xxxx.xxxx = xxx xxxxxxxx();
xxxx.xxxxxxxx = xxx xxxxxxxxxxxxxxxxxxxxxx(“xxxxx”);
Preview CargoShipTest.java
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxxxxxxx xxxxxxx xxxxxxxx {
public CargoShipTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(CargoShipTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
Preview DataLoaderTest.java
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
public DataLoaderTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(DataLoaderTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
Preview DockTest.java
xxxxxx xxx.xxxxx.xxxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxx xxxxxxx xxxxxxxx {
public DockTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(DockTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
Preview GameLoaderTest.java
xxxxxx xxxxx xxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxxxxxx(xxxxxx xxxxxxxx) {
xxxxx(xxxxxxxx);
}
@BeforeClass public static void setUpClass() throws Exception { }
@AfterClass public static void tearDownClass() throws Exception { }
@Before public void setUp() throws Exception { }
@xxxxx
xxxxxx xxxx xxxxxxxx() xxxxxx xxxxxxxxx {
}
xxxxxx xxxxxx xxxx xxxxx() {
Preview JobTest.java
xxxxxx xxxxxx xxxxx.xxxxxxxxx.xxxxxxxx.xxxxxxxxxx;
xxxxxx xxxxx.xxxxxxxxx.xxxxxxxxx;
xxxxxx xxx.xxxxx.xxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxxxx;
import org.junit.BeforeClass; import org.junit.Test;
public class JobTest extends TestCase {
public JobTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(JobTest.class); return suite; }
@xxxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxx() {
}
@xxxxxxxxxx
Preview MapsTest.java
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxx() {
}
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(MapsTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@AfterClass
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
}
Preview PassengerShipTest.java
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxxxxxxxxx() {
}
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(PassengerShipTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@AfterClass
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
}
Preview PersonTest.java
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxx() {
}
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(PersonTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@AfterClass
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
}
Preview PortTimeTest.java
xxxxxx xxxxx xxxxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxxxx() {
}
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(PortTimeTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@AfterClass public static void tearDownClass() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
}
Preview RootSuite.java
xxxxxxx xxxxxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxx;
import org.junit.Before; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Suite;
@RunWith(Suite.class) @Suite.SuiteClasses({DockTest.class, PassengerShipTest.class, CargoShipTest.class, JobTest.class, SeaPortTest.class, WorldTest.class, ThingTest.class, PortTimeTest.class, TestProgramTest.class, DebugTest.class, ShipTest.class, DataLoaderTest.class, PersonTest.class})
xxxxxx xxxxx xxxxxxxxx {
@xxxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxx() xxxxxx xxxxxxxxx {
}
Preview SeaPortPackageSuite.java
xxxxxx xxx.xxxxx.xxxxxxx.xxxxx;
@xxxxxxx(xxxxx.xxxxx)
@xxxxx.xxxxxxxxxxxx({xxxxxxxxxxxx.xxxxx, xxxxxxxxx.xxxxx, xxxxxxxxx.xxxxx, xxxxxxxx.xxxxx, xxxxxxxxxxxxxxx.xxxxx, xxxxxxxxx.xxxxx, xxxxxxxxxxxxxx.xxxxx, xxxxxxxxxxx.xxxxx, xxxxxxxx.xxxxx, xxxxxxxxxxxxxxxxx.xxxxx, xxxxxxxx.xxxxx, xxxxxxxxxxxxxx.xxxxx, xxxxxxx.xxxxx, xxxxxxxxxx.xxxxx, xxxxxxxxxxxxxxxxxx.xxxxx, xxxxxxxxxxxxx.xxxxx})
xxxxxx xxxxx xxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
public SeaPortPackageSuite(String testName) { super(testName); }
@BeforeClass public static void setUpClass() throws Exception { }
@AfterClass public static void tearDownClass() throws Exception { }
@xxxxxx
xxxxxx xxxx xxxxx() xxxxxx xxxxxxxxx {
}
@xxxxx
Preview SeaPortProgramTest.java
xxxxxx xxxxx xxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxxxxxxxxxx() {
}
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(SeaPortProgramTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@AfterClass public static void tearDownClass() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
}
Preview SeaPortTest.java
xxxxxx xxx.xxxxx.xxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxx;
public class SeaPortTest extends TestCase {
public SeaPortTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(SeaPortTest.class); return suite; }
@BeforeClass public static void setUpClass() {
}
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
Preview ShipTest.java
xxxxxx xxxxx.xxxxxxxxx.xxxxxxxxx;
xxxxxx xxx.xxxxx.xxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
import org.junit.Test;
public class ShipTest extends TestCase {
public ShipTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(ShipTest.class); return suite; }
@xxxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxx() {
}
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
Preview SkillsMapTest.java
xxxxxx xxxxxxxxxxxxx(xxxxxx xxxxxxxx) {
xxxxx(xxxxxxxx);
}
public static Test suite() { TestSuite suite = new TestSuite(SkillsMapTest.class); return suite; }
public void testAddSkill() { System.out.println(“addSkill”); String st = “aSkill”; Map
mp = new HashMap<>(); mp.put(1, new Person(“aPerson 0 aSkill”)); mp.put(2, new Person(“aPerson2 0 aSkill”)); SkillsMap instance = new SkillsMap(mp);
xxxxxxxx.xxxxxxxx(xx);
xxxxxxxxxxxx(3, (xxx)xxxxxxxx.xxxxxx().xxx(“xxxxxx”));
}
xxxxxx xxxx xxxxxxxxxxxx() {
xxxxxx.xxx.xxxxxxx(“xxxxxxxx”);
Preview SkillsSemaphoreTest.java
xxxxxx xxxxx xxxxxxxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxxxxxxxxxxx(xxxxxx xxxxxxxx) {
xxxxx(xxxxxxxx);
}
public static Test suite() { TestSuite suite = new TestSuite(SkillsSemaphoreTest.class); return suite; }
public void testForSkill() { System.out.println(“forSkill”); String st = “carpenter”; Map
mp = new HashMap<>(); mp.put(3, new Person(“aPerson 0 carpenter”));
xxxxxxxxxxxxxxx xxxxxxxx = xxx xxxxxxxxxxxxxxx(xxx xxxxxxxxx(xx));
xxx xxxxxxxxx = 1;
xxx xxxxxx = xxxxxxxx.xxxxxxxx(xx).xxxxxxxxxxxxxxxx();
xxxxxxxxxxxx(xxxxxxxxx, xxxxxx);
}
Preview SortMapTest.java
xxxxx(xxxxxxxx);
}
xxxxxx xxxxxx xxxx xxxxx() {
xxxxxxxxx xxxxx = xxx xxxxxxxxx(xxxxxxxxxxx.xxxxx);
return suite; }
@Override protected void setUp() throws Exception { super.setUp(); }
@Override protected void tearDown() throws Exception { super.tearDown(); }
xxxxxx xxxx xxxxxxxxxxxxx() {
xxxxxx.xxx.xxxxxxx(“xxxxxxxxx”);
xxxx.xxxxxxxxxxx xxxx = xxxx.xxxxxxxxxxx.xxxxxx;
xxxx.xxxxxxxxx(xxxx);
}
Preview TestProgramTest.java
xxxxxx xxxxx xxxxxxxxxxxxxxx xxxxxxx xxxxxxxx {
xxxxxx xxxxxxxxxxxxxxx() {
}
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(TestProgramTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@AfterClass public static void tearDownClass() { }
@xxxxxx
xxxxxx xxxx xxxxx() {
}
@xxxxx
Preview ThingTest.java
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxxx xxxxxxx xxxxxxxx {
public ThingTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(ThingTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
xxxxxx xxxx xxxxx() {
Preview WorldTest.java
xxxxxx xxx.xxxxx.xxxxxx;
xxxxxx xxx.xxxxx.xxxxxxxxxxx;
xxxxxx xxx.xxxxx.xxxx;
xxxxxx xxxxx xxxxxxxxx xxxxxxx xxxxxxxx {
public WorldTest() { }
public static junit.framework.Test suite() { TestSuite suite = new TestSuite(WorldTest.class); return suite; }
@BeforeClass public static void setUpClass() { }
@xxxxxxxxxx
xxxxxx xxxxxx xxxx xxxxxxxxxxxxx() {
}
@xxxxxx
Preview testRead.txt
xxxx xxxxxxx 19999 0
xxxx xxxx_4 20004 10000 30004
xxxx xxxx_0 20000 10000 30000
xxxx xxxx_1 20001 10000 30001
xxxx xxxx_3 20003 10000 30003
dock Pier_2 20002 10000 30002 pship Gallinules 30000 20000 125.99 234.70 60.67 37.14 746 246 246 pship Remora 30001 20001 126.38 358.27 74.12 31.54 3768 979 979 pship Absentmindedness 30004 20004 86.74 450.43 33.13 41.67 2143 920 920 pship Preanesthetic 30003 20003 149.85 483.92 125.71 31.21 166 409 83 pship Shoetrees 30002 20002 134.41 156.96 120.31 35.20 1673 633 633 cship Erosional 40001 10000 200.80 242.33 38.31 23.49 172.73 188.54 235.57
xxxxx xxxxxxxxx 40000 10000 120.85 362.55 96.82 19.09 33.08 188.31 261.57
xxxxx xxxxxxxx 40002 10000 79.90 234.26 73.18 15.71 125.27 179.00 729.95
xxxxx xxxxxxxxx 40003 10000 219.92 443.54 104.44 34.16 86.69 139.89 813.72
xxxxx xxxxxxx 40004 10000 189.12 448.99 73

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.