1 /****************************************************************************/ 2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo 3 // Copyright (C) 2010-2019 German Aerospace Center (DLR) and others. 4 // This program and the accompanying materials 5 // are made available under the terms of the Eclipse Public License v2.0 6 // which accompanies this distribution, and is available at 7 // http://www.eclipse.org/legal/epl-v20.html 8 // SPDX-License-Identifier: EPL-2.0 9 /****************************************************************************/ 10 /// @file MSSOTLDefinitions.h 11 /// @author Gianfilippo Slager 12 /// @date Mar 2010 13 /// @version $Id$ 14 /// 15 // The repository for definitions about SOTL and Swarm-based logics 16 /****************************************************************************/ 17 18 #ifndef MSSOTLDefinitions_h 19 #define MSSOTLDefinitions_h 20 21 ///For MSSOTLSensors 22 //SENSOR_START in meters, counting from the traffic light and moving backward with respect to traffic direction 23 #define SENSOR_START 0.0f 24 //INPUT_SENSOR_LENGTH in meters, counting from SENSOR_START and moving backward with respect to traffic direction 25 #define INPUT_SENSOR_LENGTH 100.0f 26 #define OUTPUT_SENSOR_LENGTH 80.0f 27 28 //TODO Check the distances for the count sensors 29 #define INPUT_COUNT_SENSOR_LENGTH 15.0f 30 #define OUTPUT_COUNT_SENSOR_LENGTH 15.0f 31 #define COUNT_SENSOR_START 10000.0f 32 ////For MSSOTLE2Sensors 33 //E2 Detector parameter: the time in seconds a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed 34 #define HALTING_TIME_THRS 10 35 //E2 Detector parameter: the speed in meters/second a vehicle's speed must be below to be assigned as jammed 36 #define HALTING_SPEED_THRS 1 37 //E2 Detector parameter: the distance in meters between two vehicles in order to not count them to one jam 38 #define DIST_THRS 20.0 39 40 //#define SENSORS_TYPE "e2" 41 #define SENSORS_TYPE_E1 1 42 #define SENSORS_TYPE_E2 2 43 #define SENSORS_TYPE SENSORS_TYPE_E2 44 45 #include <stdlib.h> 46 47 #include <map> 48 #include <utility> 49 #include <microsim/output/MSE2Collector.h> 50 //Every lane has its own sensors, one at the beginning and one at the end 51 //Sensors can be retrieved by lanes pointer 52 typedef std::pair<MSLane*, MSE2Collector*> MSLane_MSE2Collector; 53 typedef std::map<MSLane*, MSE2Collector*> MSLane_MSE2CollectorMap; 54 55 //Sensors can be retrieved by lane Id 56 typedef std::pair<std::string, MSE2Collector*> MSLaneID_MSE2Collector; 57 typedef std::map<std::string, MSE2Collector*> MSLaneID_MSE2CollectorMap; 58 59 //Every lane has its speed limit, it can be retrieved by lane Id 60 typedef std::pair<std::string, double> MSLaneID_MaxSpeed; 61 typedef std::map<std::string, double> MSLaneID_MaxSpeedMap; 62 63 //**************************************************** 64 //Type definitions to implement the pheromone paradigm 65 typedef std::pair<std::string, double> MSLaneId_Pheromone; 66 /** 67 * This map type definition identifies a set of lanes, connected to a kind of pheromone. 68 * Pheromone can be of different kinds to express different stimuli 69 */ 70 typedef std::map<std::string, double> MSLaneId_PheromoneMap; 71 72 //**************************************************** 73 74 typedef std::set<std::string> MSLaneID_set; 75 76 typedef std::map<MSLane*, bool> LaneCheckMap; 77 typedef std::vector<std::string> LaneIdVector; 78 79 #endif 80 /****************************************************************************/ 81