public class Vehicle extends java.lang.Object implements java.lang.Comparable<Vehicle>
Constructor and Description |
---|
Vehicle(java.lang.String id,
VehicleCategory category,
Fuel fuel,
VehicleSegment segment,
EuroNorm euroNorm,
Technology technology,
Copert copert)
DeliveryVehicle constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Vehicle o)
Vehicles can be compared according to their
capacities . |
boolean |
equalCharacteristics(Vehicle vehicle)
Checks if two vehicles have the same Copert characteristics.
|
VehicleCategory |
getCategory()
Returns the vehicle category.
|
Copert |
getCopert()
Returns the vehicle copert instance, used to compute
pollution emissions.
|
CritAir |
getCritAir()
Returns the CritAir category associated to this vehicle,
computed from the vehicles properties.
|
double |
getEmissions(Pollutant pollutant,
double meanSpeed,
double distance)
Compute emissions in g according to the COPERT model.
|
EuroNorm |
getEuroNorm()
Returns the vehicle euro norm.
|
Fuel |
getFuel()
Returns the vehicle fuel.
|
java.lang.String |
getId()
Returns the vehicle id.
|
VehicleSegment |
getSegment()
Returns the vehicle sub-segment.
|
Technology |
getTechnology()
Returns the vehicle technology
|
int |
hashCode() |
java.lang.String |
toString() |
public Vehicle(java.lang.String id, VehicleCategory category, Fuel fuel, VehicleSegment segment, EuroNorm euroNorm, Technology technology, Copert copert)
id
- vehicle idcategory
- Vehicle category (Heavy duty truck or light weight)fuel
- vehicle fuel (diesel or petrol)segment
- vehicle sub-segmenteuroNorm
- euro normtechnology
- technologycopert
- associated copert instancepublic java.lang.String getId()
public VehicleCategory getCategory()
public Fuel getFuel()
public VehicleSegment getSegment()
public EuroNorm getEuroNorm()
public Technology getTechnology()
public Copert getCopert()
public CritAir getCritAir()
CritAir
public double getEmissions(Pollutant pollutant, double meanSpeed, double distance)
pollutant
- pollutant to considermeanSpeed
- Mean speed of the vehicle in m/s.distance
- Traveled distance in m.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equalCharacteristics(Vehicle vehicle)
vehicle
- deliveryVehicle to comparepublic int compareTo(Vehicle o)
capacities
.compareTo
in interface java.lang.Comparable<Vehicle>
o
- vehicle to compare