SUMO - Simulation of Urban MObility
MSSOTLPolicyBasedTrafficLightLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // The class for SOTL Policy-based logics
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright 2001-2009 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 
22 #ifndef MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
23 #define MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 //#define SWARM_DEBUG
36 #include "MSSOTLPolicy.h"
38 
49 public:
61  const std::string& id, const std::string& subid,
62  const Phases& phases, unsigned int step, SUMOTime delay,
63  const std::map<std::string, std::string>& parameters,
64  MSSOTLPolicy* policy) throw();
65 
78  const std::string& id, const std::string& subid,
79  const Phases& phases, unsigned int step, SUMOTime delay,
80  const std::map<std::string, std::string>& parameters,
81  MSSOTLPolicy* policy, MSSOTLSensors* sensors) throw();
82 
84 
86  return myPolicy;
87  }
88 
92  const std::string getLogicType() const {
93  return "policyBasedTrafficLightLogic";
94  }
96 
97 // virtual bool canRelease(SUMOTime elapsed, bool thresholdPassed, const MSPhaseDefinition* stage, int vehicleCount) throw ()=0;
98 
99 protected:
100 
101  /*
102  * @brief Contains the logic to decide the phase change
103  */
104  bool canRelease() throw();
105 
106  /*
107  * This member has to contain the switching logic for SOTL policies
108  */
109  int decideNextPhase();
110 
111 private:
113 };
114 
115 #endif /* MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ */
long long int SUMOTime
Definition: SUMOTime.h:43
const std::string getLogicType() const
Returns the type of the logic as a string.
A class that stores and controls tls and switching of their programs.
A self-organizing traffic light logic based on a particular policy.
A self-organizing traffic light logic.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
MSSOTLPolicyBasedTrafficLightLogic(MSTLLogicControl &tlcontrol, const std::string &id, const std::string &subid, const Phases &phases, unsigned int step, SUMOTime delay, const std::map< std::string, std::string > &parameters, MSSOTLPolicy *policy)
Constructor without sensors passed.
Class for a low-level policy.
Definition: MSSOTLPolicy.h:72