Commit Graph

231 Commits

Author SHA1 Message Date
Asaad Dadoush
d63335beb8 Add Class 2020-11-08 03:05:52 +03:00
asaad
8c17a87105 Added classes: 2020-11-08 02:38:37 +03:00
asaad
be384ebf76 SUV Class 2020-11-08 02:31:20 +03:00
b70bad851e Use encapsulation principal in CivilVehicle
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>
2020-11-07 12:35:35 +03:00
e65d3d16e9 Add isDone() boolean method to Accident
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>
2020-11-07 12:33:01 +03:00
IMXHERO
eeca8c5cbb
Update Campaign.java 2020-11-07 00:07:50 +03:00
IMXHERO
605dff3982
Update Campaign.java 2020-11-07 00:01:20 +03:00
eabe86923d
Fix improper UID String and getUID()
generateUID() used to produce spaces rather then
	leading zeros.
	Before
		(   1)
	After
		(0001)

	Also add getUID method
2020-11-06 23:28:58 +03:00
1372282168 Update Campaigns constructors
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>
2020-11-06 22:53:08 +03:00
3bc0940bee getVehicles() in Campaign
Allow to get ref to Array of Vehicles of Camp

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-11-06 22:49:33 +03:00
83cb6bcee7 Add Route to Vehicle
This is debatable since every Campgians has routes
	but is done to support all cases.

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-11-06 22:42:15 +03:00
f8b5e79187 Add ref to street in every Accident
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>
2020-11-06 22:36:01 +03:00
8a4a7d8f29 Campaign and new enums Mashier, Distrcit:
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>
2020-11-06 21:48:59 +03:00
d7cbd2910d
remove Date check on Accident
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>
2020-10-27 11:55:39 +03:00
8e20f78eb9
Remove Gender enum:
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>
2020-10-27 07:52:19 +03:00
04149a4853
remove imports 2020-10-21 11:48:23 +03:00
eb94de2754 Remake Vehicle classes
- 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>
2020-10-21 11:35:19 +03:00
1b8b05cbb5 Remove Cap from Sedan and implement fix() from Breakable
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-10-21 05:45:16 +03:00
49f7be0ceb Campaign update:
- Remove fields as discussed in first project meeting
	- Add 2 Routes to each object with get/set

Signed-off-by: HeshamTB <hishaminv@gmail.com>
2020-10-21 05:42:45 +03:00
e12c5ec296
Added classes:
- Bus class that extends Vehicle and implements Breakable
	- Street class and properties
	- Route still to be updated. Add Locations for start/end?
2020-10-21 03:15:03 +03:00
c5db5dcac0
Traffic police implements CanFixAcc
SetVehicleSize is private
2020-10-20 12:55:16 +03:00
2c6721c89a
Merge branch 'master' of https://github.com/HeshamTB/Hajj-simulation into master 2020-10-20 12:52:22 +03:00
1326b2240f
ignore out folder
add artifact build
2020-10-20 12:33:36 +03:00
16ce4857c8 Restructure of Oct 18th meeting
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
2020-10-20 02:33:57 +03:00
97620bce11
Use packages/folders for grouped classes 2020-10-16 07:27:40 +03:00
ab9e26f9ab
idea file 2020-10-16 07:24:32 +03:00
07e6b0c627
Added Accident class 2020-10-16 06:52:46 +03:00
de0331088f
Restructer and add CanFixAccident
- Move Capacity field to Vehicle class
	- Improve Breakable interface
2020-10-16 05:56:03 +03:00
58dfb37437
Pilgrim:
- Add static count of object. Increment in constructor and decrement in overidden 'finalize' method
	- Throw IllegalArgumentException instead of Exception for passport and age
2020-10-11 04:10:36 +03:00
3dbb440370
Added Vehicle data structure 2020-10-09 22:58:00 +03:00
50fcd50693
init commit
- Campaign, Pilgrim and enums
	- Project files
2020-10-09 22:22:37 +03:00