Autopysta
Loading...
Searching...
No Matches
creator_martinez_jin_2020.h
Go to the documentation of this file.
1
11#ifndef _CREATOR_MARTINEZ_JIN_2020
12#define _CREATOR_MARTINEZ_JIN_2020
13
14#include "creator.h"
15#include "martinez_jin_2020.h"
16#include "p_martinez_jin_2020.h"
17#include "random_generator.h"
18#include "vehicle.h"
19
20using namespace std;
21
30private:
31 double ksi = 0.5;
32 double avg_kj = 0.14;
33 double spacing;
34 double initial_speed;
36
46 point* ideal_conditions(point*) override;
47
54 void initialize_parameters();
55
63 martinez_jin_2020* get_random_martinez_jin();
64
65public:
66 double a;
67 double b;
68
79 creator_martinez_jin_2020(p_martinez_jin_2020* model_params, double _spacing, double _initial_speed);
80
93 creator_martinez_jin_2020(p_martinez_jin_2020* model_params, double _spacing, double _initial_speed, double ksi, double avg_kj);
94
106 creator_martinez_jin_2020(p_martinez_jin_2020* model_params, double _spacing, double _initial_speed, int maxvehs);
107
121 creator_martinez_jin_2020(p_martinez_jin_2020* model_params, double _spacing, double _initial_speed, double ksi, double avg_kj, int maxvehs);
122
133 vehicle* create(point* leader, bool immediate_follower = false) override;
134
143 vehicle* create_no_leader(int lane) override;
144
150 void validate_creator() override;
151};
152
153#endif
Vehicle creator based on the Martinez and Jin (2020) model, with random jam density.
Definition creator_martinez_jin_2020.h:29
double b
Maximum value for random jam density (uniform distribution).
Definition creator_martinez_jin_2020.h:67
creator_martinez_jin_2020(p_martinez_jin_2020 *model_params, double _spacing, double _initial_speed)
Constructs a vehicle creator with the Martinez and Jin model.
vehicle * create_no_leader(int lane) override
Creates a vehicle in an empty lane with random jam density.
double a
Minimum value for random jam density (uniform distribution).
Definition creator_martinez_jin_2020.h:66
creator_martinez_jin_2020(p_martinez_jin_2020 *model_params, double _spacing, double _initial_speed, double ksi, double avg_kj)
Constructs a vehicle creator with the Martinez and Jin model and custom jam density range.
creator_martinez_jin_2020(p_martinez_jin_2020 *model_params, double _spacing, double _initial_speed, double ksi, double avg_kj, int maxvehs)
Constructs a vehicle creator with a custom jam density range and vehicle limit.
vehicle * create(point *leader, bool immediate_follower=false) override
Creates a vehicle with random jam density behind a leader.
creator_martinez_jin_2020(p_martinez_jin_2020 *model_params, double _spacing, double _initial_speed, int maxvehs)
Constructs a vehicle creator with a limit on the number of vehicles.
void validate_creator() override
Validates the parameters of the Martinez and Jin model.
Base class for generating vehicles in a traffic simulation.
Definition creator.h:33
Martinez and Jin (2020) car-following model with constrained timestep.
Definition martinez_jin_2020.h:29
Parameter class for Martinez and Jin (2020) stochastic car-following model.
Definition p_martinez_jin_2020.h:24
Represents a point in time for a vehicle in a traffic simulation.
Definition point.h:23
Class representing a moving vehicle on the road.
Definition vehicle.h:67
Defines the creator class for generating vehicles in traffic simulations.
Header file for the martinez_jin_2020 class definition based on the Martinez and Jin (2020) car-follo...
Header file for the p_martinez_jin_2020 class definition.
Provides utilities for generating random numbers using various probability distributions.
Defines the road_object, vehicle, and fixed_object classes used to represent objects on the road.