Eclipse SUMO - Simulation of Urban MObility
Element Class Reference

#include <Element.h>

Collaboration diagram for Element:

Public Types

enum  ElementType { RESISTOR_traction_wire , CURRENT_SOURCE_traction_wire , VOLTAGE_SOURCE_traction_wire , ERROR_traction_wire }
 

Public Member Functions

 Element (string name, ElementType type, double value)
 
double getCurrent ()
 
int getId ()
 
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
 
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 42 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 45 of file Element.h.

Constructor & Destructor Documentation

◆ Element()

Element::Element ( string  name,
ElementType  type,
double  value 
)
Note
based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader

Definition at line 27 of file Element.cpp.

References current, CURRENT_SOURCE_traction_wire, isenabled, name, nNode, pNode, powerWanted, resistance, RESISTOR_traction_wire, type, voltage, and VOLTAGE_SOURCE_traction_wire.

Member Function Documentation

◆ getCurrent()

double Element::getCurrent ( )

Definition at line 79 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 102 of file Element.cpp.

References id.

◆ getName()

string Element::getName ( )

Definition at line 116 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 109 of file Element.cpp.

References nNode.

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

Here is the caller graph for this function:

◆ getPosNode()

Node * Element::getPosNode ( )

Definition at line 106 of file Element.cpp.

References pNode.

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

Here is the caller graph for this function:

◆ getPower()

double Element::getPower ( )

Definition at line 99 of file Element.cpp.

References getCurrent(), and getVoltage().

◆ getPowerWanted()

double Element::getPowerWanted ( )

Definition at line 96 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 93 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 132 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 113 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 70 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 142 of file Element.cpp.

References isenabled.

◆ setCurrent()

void Element::setCurrent ( double  current)

Definition at line 57 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 146 of file Element.cpp.

References isenabled.

◆ setId()

void Element::setId ( int  id)

Definition at line 127 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 124 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 120 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 67 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 60 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 150 of file Element.cpp.

References type.

◆ setVoltage()

void Element::setVoltage ( double  voltage)

Definition at line 54 of file Element.cpp.

References voltage.

Field Documentation

◆ current

double Element::current
private

Definition at line 56 of file Element.h.

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

◆ id

int Element::id
private

Definition at line 61 of file Element.h.

Referenced by getId().

◆ isenabled

bool Element::isenabled
private

Definition at line 62 of file Element.h.

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

◆ name

string Element::name
private

Definition at line 60 of file Element.h.

Referenced by Element(), and getName().

◆ nNode

Node* Element::nNode
private

Definition at line 54 of file Element.h.

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

◆ pNode

Node* Element::pNode
private

Definition at line 53 of file Element.h.

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

◆ powerWanted

double Element::powerWanted
private

Definition at line 58 of file Element.h.

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

◆ resistance

double Element::resistance
private

Definition at line 57 of file Element.h.

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

◆ type

ElementType Element::type
private

Definition at line 59 of file Element.h.

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

◆ voltage

double Element::voltage
private

Definition at line 55 of file Element.h.

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


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