Autopysta
Loading...
Searching...
No Matches
creator.h
Go to the documentation of this file.
1
12#ifndef CREATOR_H
13#define CREATOR_H
14
15#include <iostream>
16#include <vector>
17#include <climits>
18#include "point.h"
19#include "trajectory.h"
20#include "params.h"
21#include "vehicle.h"
22#include "model.h"
23
24using namespace std;
25
33class creator {
34protected:
35 int max_vehs = INT_MAX;
36 int n_vehs = 0;
37 model* Model = nullptr;
38
49 virtual point* ideal_conditions(point* leader) = 0;
50
51public:
59 virtual void validate_creator();
60
73 virtual vehicle* create(point* leader, bool immediate_follower = false);
74
85 virtual vehicle* create_no_leader(int lane) = 0;
86
97 vector<vehicle*> initial_state(point* leader);
98};
99
100#endif // CREATOR_H
Base class for generating vehicles in a traffic simulation.
Definition creator.h:33
virtual point * ideal_conditions(point *leader)=0
Defines the ideal conditions for creating a new vehicle.
int n_vehs
Counter for the number of vehicles created so far.
Definition creator.h:36
model * Model
Traffic model used to determine vehicle behavior.
Definition creator.h:37
virtual vehicle * create_no_leader(int lane)=0
Creates a new vehicle in an empty lane.
virtual vehicle * create(point *leader, bool immediate_follower=false)
Creates a new vehicle based on the current leader's position.
int max_vehs
Maximum number of vehicles that can be created.
Definition creator.h:35
virtual void validate_creator()
Validates the configuration of the creator.
vector< vehicle * > initial_state(point *leader)
Initializes vehicles in the first simulation timestep.
Abstract car-following model class.
Definition model.h:30
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
File for the model and lcm classes definitions (short description).
File for the params and params_cust classes definitions (short description).
File for the point class definition.
Contains definitions for the generalized_trajectory, static_trajectory, and trajectory classes.
Defines the road_object, vehicle, and fixed_object classes used to represent objects on the road.