39#define WATTHR2JOULE(_x) ((_x)*3600.0)
40#define JOULE2WATTHR(_x) ((_x)/3600.0)
41#define WATTHR2WATT(_x) ((_x)*3600.0/TS)
42#define WATT2WATTHR(_x) ((_x)*TS/3600.0)
67 MSOverheadWire(
const std::string& overheadWireSegmentID,
MSLane& lane,
double startPos,
double endPos,
161 Charge(
SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status,
162 double _WCharged,
double _actualBatteryCapacity,
double _maxBatteryCapacity,
double _voltage,
163 double _totalEnergyCharged) :
208 void static writeVehicle(
OutputDevice& out,
const std::vector<Charge>& chargeSteps,
int iStart,
int iEnd,
double charged);
314 chargeTS(
SUMOTime _timeStep, std::string _substationID, std::string _vehicleIDs,
double _energy,
315 double _current, std::string _currentsString,
double _voltage, std::string _status,
316 int _numVehicle,
int _numVoltageSources,
double _alpha,
Circuit::alphaFlag _alphaReason) :
373 const std::string
id;
384 const MSLane* connection,
const MSLane* frontConnection,
const MSLane* behindConnection);
const double WIRE_RESISTIVITY
alphaFlag
Flag of alpha scaling parameter.
Base (microsim) event class.
A device which collects info on the vehicle trip (mainly on departure and arrival)
Representation of a lane in the micro simulation.
A class for sorting vehicle on lane under the overhead wire segment.
vehicle_position_sorter()
Constructor.
int operator()(SUMOVehicle *v1, SUMOVehicle *v2)
Sorting function; compares RODFRouteDesc::distance2Last.
Definition of overhead wire segment.
std::map< std::string, std::vector< Charge > > myChargeValues
map with the charges of this charging station (key = vehicleID)
void setCircuitEndNodePos(Node *node)
const std::vector< SUMOVehicle * > & getChargingVehicles() const
bool myChargingVehicle
Check if in the current TimeStep overheadWireSegment is charging a vehicle.
Element * myCircuitElementPos
Node * myCircuitEndNodePos
void setCircuitElementPos(Element *element)
static void writeVehicle(OutputDevice &out, const std::vector< Charge > &chargeSteps, int iStart, int iEnd, double charged)
void writeOverheadWireSegmentOutput(OutputDevice &output)
write overhead wire segment values
Node * getCircuitStartNodePos() const
void setChargingVehicle(bool value)
enable or disable charging vehicle
bool vehicleIsInside(const double position) const
Check if a vehicle is inside in the Charge Station.
Node * getCircuitEndNodePos() const
double getTotalCharged() const
void setCircuitStartNodePos(Node *node)
std::string getOverheadWireSegmentName()
int getElecHybridCount() const
double myTotalCharge
total energy charged by this charging station
Node * myCircuitStartNodePos
void setVoltage(double voltage)
Set overhead wire's voltage.
std::vector< std::string > myChargedVehicles
order vehicles by time of first charge
bool isThereVoltageSource() const
bool isCharging() const
Return true if in the current time step charging station is charging a vehicle.
Circuit * getCircuit() const
double getVoltage() const
Get overhead wire's voltage.
void addChargeValueForOutput(double WCharged, MSDevice_ElecHybrid *elecHybrid, bool ischarging=1)
add charge value for output
MSTractionSubstation * getTractionSubstation() const
void eraseVehicle(SUMOVehicle &veh)
void setTractionSubstation(MSTractionSubstation *substation)
MSTractionSubstation * myTractionSubstation
Parameter, Pointer to the electrical substation (by default is nullptr)
std::vector< SUMOVehicle * > myChargingVehicles
Element * getCircuitElementPos() const
void addVehicle(SUMOVehicle &veh)
~MSOverheadWire()
destructor
MSOverheadWire & operator=(const MSOverheadWire &)
Invalidated assignment operator.
MSOverheadWire(const MSOverheadWire &)
Invalidated copy constructor.
double myVoltage
Overhead wire's voltage.
A lane area vehicles can halt at.
Traction substation powering one or more overhead wire sections.
bool myChargingVehicle
Check if in the current TimeStep substation (overhead wire section) is charging a vehicle.
void decreaseElecHybridCount()
void eraseVehicle(MSDevice_ElecHybrid *elecHybrid)
void addOverheadWireInnerSegmentToCircuit(MSOverheadWire *incomingSegment, MSOverheadWire *outgoingSegment, const MSLane *connection, const MSLane *frontConnection, const MSLane *behindConnection)
std::size_t numberOfOverheadSegments() const
double getSubstationVoltage() const
~MSTractionSubstation()
destructor
void eraseOverheadWireSegmentFromCircuit(MSOverheadWire *oldWireSegment)
std::vector< OverheadWireClamp > myOverheadWireClamps
std::vector< MSOverheadWire * > myOverheadWireSegments
void addOverheadWireClampToCircuit(const std::string id, MSOverheadWire *startSegment, MSOverheadWire *endSegment)
void addClamp(const std::string &id, MSOverheadWire *startPos, MSOverheadWire *endPos)
void addSolvingCircuitToEndOfTimestepEvents()
bool isCharging() const
Return true if in the current time step the substation (overhead wire section) is charging a vehicle.
bool isAnySectionPreviouslyDefined()
double mySubstationVoltage
void writeTractionSubstationOutput(OutputDevice &output)
write traction substation values
std::vector< MSDevice_ElecHybrid * > myElecHybrid
bool isForbidden(const MSLane *lane)
std::vector< MSLane * > myForbiddenLanes
Circuit * getCircuit() const
void increaseElecHybridCount()
void addVehicle(MSDevice_ElecHybrid *elecHybrid)
std::vector< chargeTS > myChargeValues
SUMOTime solveCircuit(SUMOTime currentTime)
void addOverheadWireSegmentToCircuit(MSOverheadWire *newOverheadWireSegment)
int getElecHybridCount() const
OverheadWireClamp * findClamp(std::string id)
Find an overhead wire clamp by its ID.
static Command * myCommandForSolvingCircuit
void addForbiddenLane(MSLane *lane)
void setChargingVehicle(bool value)
enable or disable charging vehicle
void addChargeValueForOutput(double energy, double current, double alpha, Circuit::alphaFlag alphaReason)
add charge value for output
Base class for objects which have an id.
A storage for options typed value containers)
Static storage of an output device and its base (abstract) implementation.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
struct to save information for the overhead wire segment output
double chargingEfficiency
double maxBatteryCapacity
Charge(SUMOTime _timeStep, std::string _vehicleID, std::string _vehicleType, std::string _status, double _WCharged, double _actualBatteryCapacity, double _maxBatteryCapacity, double _voltage, double _totalEnergyCharged)
constructor
double actualBatteryCapacity
double totalEnergyCharged
OverheadWireClamp(const std::string _id, MSOverheadWire *_start, MSOverheadWire *_end, bool _usage)
struct to save information for the traction substation output
Circuit::alphaFlag alphaReason
chargeTS(SUMOTime _timeStep, std::string _substationID, std::string _vehicleIDs, double _energy, double _current, std::string _currentsString, double _voltage, std::string _status, int _numVehicle, int _numVoltageSources, double _alpha, Circuit::alphaFlag _alphaReason)
constructor
std::string currentsString