vehiclesimulator script¶
vehiclesimulator¶
vehiclesimulation utilities¶
-
class
vehiclesimulationutilities.
CabinTemperatureSimulator
[source]¶ Bases:
object
Simulate the indoor temperature of a vehicle.
The temperature will increase to TEMPERATURE_HOT, but will decrease to TEMPERATURE_COLD when the air conditioner is turned on.
The warming and cooling speeds are affected by GAIN_WARMING and GAIN_COOLING. A random temperature noise is added to the measurement.
This class holds no timer or timing information, so the average rate of temperature change is dependent on how frequently you call getNewTemperature().
-
temperature
¶ float
Indoor temperature in deg C
-
aircondition_state
¶ bool
Boolean indicating whether the AC is on
-
GAIN_COOLING
= 0.05¶
-
GAIN_WARMING
= 0.02¶
-
TEMPERATURE_COLD
= 18.0¶
-
TEMPERATURE_HOT
= 32.0¶
-
TEMPERATURE_NOISE_DEVIATION
= 0.03¶
-
aircondition_state
-
-
class
vehiclesimulationutilities.
VehicleSpeedSimulator
[source]¶ Bases:
object
Simulate the speed of a vehicle.
The step size in the vehicle speed is calculated with a normalized distribution using the values:
- SPEED_STEPSIZE (Should be >0)
- SPEED_STEPDEVIATION (Should be >0)
When the speed reaches SPEED_MAX, the speed will start to decrease instead. Similarly it starts to increase again at SPEED_MIN.
This class holds no timer or timing information, so the average rate of speed change is dependent on how frequently you call getNewRandomizedSpeed().
-
currentspeed
¶ float
Vehicle speed in km/h
-
SPEED_MAX
= 110.0¶
-
SPEED_MIN
= 3.0¶
-
SPEED_STEPDEVIATION
= 0.9¶
-
SPEED_STEPSIZE
= 0.3¶