Eclipse SUMO - Simulation of Urban MObility
Element Class Reference

#include <Element.h>

Collaboration diagram for Element:
[legend]

Public Types

enum  ElementType { RESISTOR_traction_wire , CURRENT_SOURCE_traction_wire , VOLTAGE_SOURCE_traction_wire , ERROR_traction_wire }
 

Public Member Functions

 Element (std::string name, ElementType type, double value)
 
double getCurrent ()
 
int getId ()
 
std::string getName ()
 
NodegetNegNode ()
 
NodegetPosNode ()
 
double getPower ()
 
double getPowerWanted ()
 
double getResistance ()
 
NodegetTheOtherNode (Node *node)
 
ElementType getType ()
 
double getVoltage ()
 
bool isEnabled ()
 
void setCurrent (double current)
 
void setEnabled (bool isenabled)
 
void setId (int id)
 
void setNegNode (Node *node)
 
void setPosNode (Node *node)
 
void setPowerWanted (double powerWanted)
 
void setResistance (double resistance)
 
void setType (ElementType ET)
 
void setVoltage (double voltage)
 

Private Attributes

double current
 
int id
 
bool isenabled
 
std::string name
 
NodenNode
 
NodepNode
 
double powerWanted
 
double resistance
 
ElementType type
 
double voltage
 

Detailed Description

An element is any component in the circuit (resistor, current source, voltage source) Every element has two terminals pNode (positive terminal) and nNode (negative terminal) value is the resistance in case of a resistor, current in case of a current source and voltage in case of voltage source.

Conventions used:

1 - in case of a current source, "value" represents the current going from nNode to pNode, 2 - in case of a voltage source, "value" represents the voltage difference of pNode - nNode.

Definition at line 50 of file Element.h.

Member Enumeration Documentation

◆ ElementType

Enumerator
RESISTOR_traction_wire 
CURRENT_SOURCE_traction_wire 
VOLTAGE_SOURCE_traction_wire 
ERROR_traction_wire 

Definition at line 53 of file Element.h.

Constructor & Destructor Documentation

◆ Element()

Element::Element ( std::string  name,
ElementType  type,
double  value 
)

Member Function Documentation

◆ getCurrent()

double Element::getCurrent ( )

Definition at line 85 of file Element.cpp.

References current, getVoltage(), isenabled, resistance, and type.

Referenced by Circuit::getCurrent(), getPower(), and MSTractionSubstation::solveCircuit().

Here is the caller graph for this function:

◆ getId()

int Element::getId ( )

Definition at line 108 of file Element.cpp.

References id.

◆ getName()

std::string Element::getName ( )

Definition at line 122 of file Element.cpp.

References name.

Referenced by MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ getNegNode()

Node * Element::getNegNode ( )

Definition at line 115 of file Element.cpp.

References nNode.

Referenced by Circuit::eraseElement(), MSDevice_ElecHybrid::notifyMove(), and MSOverheadWire::~MSOverheadWire().

Here is the caller graph for this function:

◆ getPosNode()

Node * Element::getPosNode ( )

Definition at line 112 of file Element.cpp.

References pNode.

Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit(), Circuit::deployResults(), Circuit::eraseElement(), MSDevice_ElecHybrid::notifyMove(), and MSOverheadWire::~MSOverheadWire().

Here is the caller graph for this function:

◆ getPower()

double Element::getPower ( )

Definition at line 105 of file Element.cpp.

References getCurrent(), and getVoltage().

◆ getPowerWanted()

double Element::getPowerWanted ( )

Definition at line 102 of file Element.cpp.

References powerWanted.

Referenced by MSDevice_ElecHybrid::getPowerWanted(), and MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ getResistance()

double Element::getResistance ( )

Definition at line 99 of file Element.cpp.

References resistance.

Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit(), Circuit::deployResults(), Circuit::getResistance(), and MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ getTheOtherNode()

Node * Element::getTheOtherNode ( Node node)

Definition at line 138 of file Element.cpp.

References nNode, and pNode.

Referenced by Circuit::deployResults().

Here is the caller graph for this function:

◆ getType()

Element::ElementType Element::getType ( )

Definition at line 119 of file Element.cpp.

References type.

Referenced by Circuit::addElement(), and getVoltage().

Here is the caller graph for this function:

◆ getVoltage()

double Element::getVoltage ( )

Definition at line 76 of file Element.cpp.

References getType(), Node::getVoltage(), isenabled, nNode, pNode, and voltage.

Referenced by getCurrent(), getPower(), Circuit::getVoltage(), and MSTractionSubstation::solveCircuit().

Here is the caller graph for this function:

◆ isEnabled()

bool Element::isEnabled ( )

Definition at line 148 of file Element.cpp.

References isenabled.

◆ setCurrent()

void Element::setCurrent ( double  current)

Definition at line 63 of file Element.cpp.

References current.

Referenced by MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ setEnabled()

void Element::setEnabled ( bool  isenabled)

Definition at line 152 of file Element.cpp.

References isenabled.

◆ setId()

void Element::setId ( int  id)

Definition at line 133 of file Element.cpp.

Referenced by Circuit::addElement(), MSDevice_ElecHybrid::deleteVehicleFromCircuit(), and Circuit::replaceAndDeleteNode().

Here is the caller graph for this function:

◆ setNegNode()

void Element::setNegNode ( Node node)

Definition at line 130 of file Element.cpp.

References nNode.

Referenced by Circuit::addElement().

Here is the caller graph for this function:

◆ setPosNode()

void Element::setPosNode ( Node node)

Definition at line 126 of file Element.cpp.

References pNode.

Referenced by Circuit::addElement(), MSDevice_ElecHybrid::deleteVehicleFromCircuit(), and MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ setPowerWanted()

void Element::setPowerWanted ( double  powerWanted)

Definition at line 73 of file Element.cpp.

References powerWanted.

Referenced by MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ setResistance()

void Element::setResistance ( double  resistance)

Definition at line 66 of file Element.cpp.

References resistance.

Referenced by MSDevice_ElecHybrid::notifyMove().

Here is the caller graph for this function:

◆ setType()

void Element::setType ( ElementType  ET)

Definition at line 156 of file Element.cpp.

References type.

◆ setVoltage()

void Element::setVoltage ( double  voltage)

Definition at line 60 of file Element.cpp.

References voltage.

Field Documentation

◆ current

double Element::current
private

Definition at line 64 of file Element.h.

Referenced by Element(), getCurrent(), and setCurrent().

◆ id

int Element::id
private

Definition at line 69 of file Element.h.

Referenced by getId().

◆ isenabled

bool Element::isenabled
private

Definition at line 70 of file Element.h.

Referenced by Element(), getCurrent(), getVoltage(), isEnabled(), and setEnabled().

◆ name

std::string Element::name
private

Definition at line 68 of file Element.h.

Referenced by Element(), and getName().

◆ nNode

Node* Element::nNode
private

Definition at line 62 of file Element.h.

Referenced by Element(), getNegNode(), getTheOtherNode(), getVoltage(), and setNegNode().

◆ pNode

Node* Element::pNode
private

Definition at line 61 of file Element.h.

Referenced by Element(), getPosNode(), getTheOtherNode(), getVoltage(), and setPosNode().

◆ powerWanted

double Element::powerWanted
private

Definition at line 66 of file Element.h.

Referenced by Element(), getPowerWanted(), and setPowerWanted().

◆ resistance

double Element::resistance
private

Definition at line 65 of file Element.h.

Referenced by Element(), getCurrent(), getResistance(), and setResistance().

◆ type

ElementType Element::type
private

Definition at line 67 of file Element.h.

Referenced by Element(), getCurrent(), getType(), and setType().

◆ voltage

double Element::voltage
private

Definition at line 63 of file Element.h.

Referenced by Element(), getVoltage(), and setVoltage().


The documentation for this class was generated from the following files: