Class Vehicle<TSteeringCapable, TPassengerCapable, TSteeringHandle, TPassengerHandle>
The
Vehicle
is the definition of all RoadUser
s that are usable for drivers and their
passengers.
Inheritance
System.Object
Vehicle<TSteeringCapable, TPassengerCapable, TSteeringHandle, TPassengerHandle>
Implements
IVehicleEntrance<TSteeringCapable, TPassengerCapable, TSteeringHandle, TPassengerHandle>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SOHDomain.Model
Assembly: SOHDomain.dll
Syntax
public abstract class Vehicle<TSteeringCapable, TPassengerCapable, TSteeringHandle, TPassengerHandle> : RoadUser, ISpatialGraphEntity, IEntity, IModelObject, IPositionable, IVehicleEntrance<TSteeringCapable, TPassengerCapable, TSteeringHandle, TPassengerHandle> where TSteeringCapable : ISteeringCapable where TPassengerCapable : IPassengerCapable where TSteeringHandle : ISteeringHandle where TPassengerHandle : IPassengerHandle
Type Parameters
Name | Description |
---|---|
TSteeringCapable | Defines the capabilities of someone who is able to steer this vehicle. |
TPassengerCapable | Defines the capabilities of someone who is able to co-drive in this vehicle. |
TSteeringHandle | Defines the "cockpit" of this vehicle. The steering handle allows to navigate the vehicle. |
TPassengerHandle | Defines the actions that a passenger have within this vehicle. |
Properties
| Improve this Doc View SourceDriver
Gets or sets the driver of this vehicle, which acts at the active agent entity, using the vehicle.
Declaration
public ISteeringCapable Driver { get; set; }
Property Value
Type | Description |
---|---|
ISteeringCapable |
ExploreDistanceFactor
Gets or sets the factor >= 0 to explore/look forward or backward for other entiy
in order to interacting with them.
Declaration
public int ExploreDistanceFactor { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
This factor need only suitable value in order to check for the most recent case.
As greater this value is, as worse execution performance.
|
Improve this Doc
View Source
IntersectionSpeed
Gets or sets the maximum speed when moving forward and passing an intersection,
defined by the Up.
Declaration
public double IntersectionSpeed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
MaxAcceleration
Gets or sets the maximum acceleration to
increase
the speed of this
vehicle in meter per squared second (m/s²)
.
Declaration
public double MaxAcceleration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
MaxDeceleration
Gets or sets the maximum deceleration to
decrease
the speed of this
vehicle in meter per squared second (m/s²)
.
Declaration
public double MaxDeceleration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
MaxSpeed
Gets or sets the maximum moving speed limit of this vehicle in
meter per second (m/s)
.
Declaration
public double MaxSpeed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
PassengerCapacity
Gets or sets the maximum amount of passenger (without the driver itself) in this vehicle.
Declaration
public int PassengerCapacity { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Suitable parameter values are 0, 2, 4,5 seats for default bicycle, or car vehicles.
|
Improve this Doc
View Source
Passengers
Gets or sets the collection of passenger entered in this vehicle.
Declaration
public List<IPassengerCapable> Passengers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<IPassengerCapable> |
RegularTurnSpeed
Gets or sets the maximum speed when turning at a default intersection,
defined by the Left or Right.
Declaration
public double RegularTurnSpeed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
SharpTurnSpeed
Gets or sets the maximum speed when turning at intersection very sharp,
defined by the DownLeft or DownRight.
Declaration
public double SharpTurnSpeed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
TrafficCode
Get or sets the intersection behaviour model identified by code when no traffic signals are available
"german" = right before left rule
"southAfrica" = first in first out (FIFO) rule
Declaration
public string TrafficCode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
UTurnSpeed
Gets or sets the maximum speed when making a U-turn at an intersection,
defined by the Down.
Declaration
public double UTurnSpeed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
WideTurnSpeed
Gets or sets the maximum speed when turning at intersection very wide,
defined by the UpLeft or UpRight.
Declaration
public double WideTurnSpeed { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceCreatePassengerHandle()
Creates a passenger handle that provides access to passenger functionality.
Declaration
protected abstract TPassengerHandle CreatePassengerHandle()
Returns
Type | Description |
---|---|
TPassengerHandle | A handle for passenger functionality. |
CreateSteeringHandle(TSteeringCapable)
Creates a steering handle that provides access to steering functionality.
Declaration
protected abstract TSteeringHandle CreateSteeringHandle(TSteeringCapable driver)
Parameters
Type | Name | Description |
---|---|---|
TSteeringCapable | driver |
Returns
Type | Description |
---|---|
TSteeringHandle | A handle for steering functionality. |
HasFreeCapacity()
The
Vehicle
is the definition of all RoadUser
s that are usable for drivers and their
passengers.
Declaration
public virtual bool HasFreeCapacity()
Returns
Type | Description |
---|---|
System.Boolean |
IsInRangeToEnterVehicle(IPassengerCapable)
Hook-method to check if entering a vehicle should be allowed,
based on the distance between passenger and vehicle.
Declaration
protected virtual bool IsInRangeToEnterVehicle(IPassengerCapable passenger)
Parameters
Type | Name | Description |
---|---|---|
IPassengerCapable | passenger | Of which the distance to this vehicle is tested. |
Returns
Type | Description |
---|---|
System.Boolean | True, if the range check succeeds, false otherwise. |
LeaveVehicle(TPassengerCapable)
The
Vehicle
is the definition of all RoadUser
s that are usable for drivers and their
passengers.
Declaration
public virtual void LeaveVehicle(TPassengerCapable passenger)
Parameters
Type | Name | Description |
---|---|---|
TPassengerCapable | passenger |
NotifyPassengers(PassengerMessage)
Notifies all passengers and the driver.
Declaration
public virtual void NotifyPassengers(PassengerMessage passengerMessage)
Parameters
Type | Name | Description |
---|---|---|
PassengerMessage | passengerMessage | Notification message for all passengers. |
TryEnterDriver(TSteeringCapable, out TSteeringHandle)
The passenger tries to enter the vehicle in the driver role. On success the driver is able to steer the
vehicle with the given handle.
ATTENTION: This method only affects the vehicle parameters. The broader context (driver was
probably a pedestrian in another environment) has to be taken into consideration and adjusted to the new
modal context.
Declaration
public virtual bool TryEnterDriver(TSteeringCapable driver, out TSteeringHandle handle)
Parameters
Type | Name | Description |
---|---|---|
TSteeringCapable | driver | That will drive the vehicle. |
TSteeringHandle | handle | The steering handle that can be used by the driver to control the vehicle. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the driver could enter the vehicle or not. |
TryEnterPassenger(TPassengerCapable, out TPassengerHandle)
The passenger tries to enter the vehicle as co-driver.
ATTENTION: This method only affects the vehicle parameters. The broader context (passenger was
probably a pedestrian in another environment) has to be taken into consideration and adjusted to the new
modal context.
Declaration
public virtual bool TryEnterPassenger(TPassengerCapable passenger, out TPassengerHandle handle)
Parameters
Type | Name | Description |
---|---|---|
TPassengerCapable | passenger | That will board the vehicle for transportation. |
TPassengerHandle | handle | The passenger handle that provides the possibility to be moved. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the passenger could enter the vehicle or not. |
TurningSpeedFor(DirectionType)
Gets the turning speed when passing an intersection for the given relative target
direction
.Declaration
public double TurningSpeedFor(DirectionType direction)
Parameters
Type | Name | Description |
---|---|---|
DirectionType | direction | The relative direction compass with |
Returns
Type | Description |
---|---|
System.Double |
Returns the maximum speed to adjust in meter per seconds (m/s) ,
used when driving into the target relative
direction . |