![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <Element.h>
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 () |
Node * | getNegNode () |
Node * | getPosNode () |
double | getPower () |
double | getPowerWanted () |
double | getResistance () |
Node * | getTheOtherNode (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 |
Node * | nNode |
Node * | pNode |
double | powerWanted |
double | resistance |
ElementType | type |
double | voltage |
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.
enum Element::ElementType |
Element::Element | ( | string | name, |
ElementType | type, | ||
double | value | ||
) |
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.
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().
int Element::getId | ( | ) |
Definition at line 102 of file Element.cpp.
References id.
string Element::getName | ( | ) |
Definition at line 116 of file Element.cpp.
References name.
Referenced by MSDevice_ElecHybrid::notifyMove().
Node * Element::getNegNode | ( | ) |
Definition at line 109 of file Element.cpp.
References nNode.
Referenced by MSDevice_ElecHybrid::notifyMove(), and MSOverheadWire::~MSOverheadWire().
Node * Element::getPosNode | ( | ) |
Definition at line 106 of file Element.cpp.
References pNode.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit(), MSDevice_ElecHybrid::notifyMove(), and MSOverheadWire::~MSOverheadWire().
double Element::getPower | ( | ) |
Definition at line 99 of file Element.cpp.
References getCurrent(), and getVoltage().
double Element::getPowerWanted | ( | ) |
Definition at line 96 of file Element.cpp.
References powerWanted.
Referenced by MSDevice_ElecHybrid::getPowerWanted(), and MSDevice_ElecHybrid::notifyMove().
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().
Definition at line 132 of file Element.cpp.
Referenced by Circuit::deployResults().
Element::ElementType Element::getType | ( | ) |
Definition at line 113 of file Element.cpp.
References type.
Referenced by Circuit::addElement(), and 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().
bool Element::isEnabled | ( | ) |
Definition at line 142 of file Element.cpp.
References isenabled.
void Element::setCurrent | ( | double | current | ) |
Definition at line 57 of file Element.cpp.
References current.
Referenced by MSDevice_ElecHybrid::notifyMove().
void Element::setEnabled | ( | bool | isenabled | ) |
Definition at line 146 of file Element.cpp.
References isenabled.
void Element::setId | ( | int | id | ) |
Definition at line 127 of file Element.cpp.
Referenced by Circuit::addElement(), MSDevice_ElecHybrid::deleteVehicleFromCircuit(), and Circuit::replaceAndDeleteNode().
void Element::setNegNode | ( | Node * | node | ) |
Definition at line 124 of file Element.cpp.
References nNode.
Referenced by Circuit::addElement().
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().
void Element::setPowerWanted | ( | double | powerWanted | ) |
Definition at line 67 of file Element.cpp.
References powerWanted.
Referenced by MSDevice_ElecHybrid::notifyMove().
void Element::setResistance | ( | double | resistance | ) |
Definition at line 60 of file Element.cpp.
References resistance.
Referenced by MSDevice_ElecHybrid::notifyMove().
void Element::setType | ( | ElementType | ET | ) |
Definition at line 150 of file Element.cpp.
References type.
void Element::setVoltage | ( | double | voltage | ) |
Definition at line 54 of file Element.cpp.
References voltage.
|
private |
Definition at line 56 of file Element.h.
Referenced by Element(), getCurrent(), and setCurrent().
|
private |
Definition at line 62 of file Element.h.
Referenced by Element(), getCurrent(), getVoltage(), isEnabled(), and setEnabled().
|
private |
|
private |
Definition at line 54 of file Element.h.
Referenced by Element(), getNegNode(), getTheOtherNode(), getVoltage(), and setNegNode().
|
private |
Definition at line 53 of file Element.h.
Referenced by Element(), getPosNode(), getTheOtherNode(), getVoltage(), and setPosNode().
|
private |
Definition at line 58 of file Element.h.
Referenced by Element(), getPowerWanted(), and setPowerWanted().
|
private |
Definition at line 57 of file Element.h.
Referenced by Element(), getCurrent(), getResistance(), and setResistance().
|
private |
|
private |
Definition at line 55 of file Element.h.
Referenced by Element(), getVoltage(), and setVoltage().