Since every occurrence of collide should set
currentAccident and broken for all cars, use
setCurrentAccident() for both cars in collide()
which sets both values.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
isDone() checks all invovlved CivilVehicles
in Accident instance. If any car has reference
to 'this' then it is still not done.
Done would be true if fix() of each car is invoked.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
General improved constructors with regard to
agreed upon final UML.
generateUID() method to set UID for camp
in constructors based on the new static int
'numberOfCampaigns'. 0001, 0002, ...
The type os UID is now String to accommodate
the leading zeros.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
Add Street Object for Accident as location
for Instances of Accident.
Removed 'isInAccident()' from 'Breakable' interface
The idea is from Previous suggested UML that replaces
Broken and Accident with getStatus() that gives info about
Breakable object. isBroken() now returns 1 if its eaither in
Accident or Broken. Can check getCurrentAccident() for null.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
Signed-off-by: HeshamTB <hishaminv@gmail.com>
Update according to UML
Set vehicles for camp
new Constructor for camp
Enum for District and Mashier. This will be set as endpoints
for Streets, Routes or Campaigns.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
Removed the check on date of accidnet due
to incomplete information. The start date of
the simulation will be a static object in the
future. Implement checks when added. TODO is
there to reminde.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
The gender enum was made to be used with the removed
Pilgrim class. The previous class and simulation vision
has changed to be more targeted toward Vehicle flow and
ignore dead-weight information like Pilgrims.
Priority enum is still avialable to be used with campaigns
to give preset priority for expermintation.
Signed-off-by: HeshamTB <hishaminv@gmail.com>
- Abstract class CivilVehicle that implements Breakable and
contains all common fields of vehicles. Now for example,
Sedan <- CivilVehicle <- Vehicle
^
Breakable
The breakable methods are mostly implemented in CivilVehicle
Except getTimeToFix() which is defined in subclasses of
CivilVehicle.
- Breakable interface:
The method collide() now returns instance of Accident instead of
void
Signed-off-by: HeshamTB <hishaminv@gmail.com>
some of the changes proposed in 18-10-2020 meeting:
- GovtCar marker interface (CanBeGovtCar)
- Remove isGovt from vehicle and Sedan constructors
- Remove Pilgrim.java class
- Remove PermitedForHaj.java interface
- Add static count of object. Increment in constructor and decrement in overidden 'finalize' method
- Throw IllegalArgumentException instead of Exception for passport and age