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 (std::string name, ElementType type, double value) | |
double | getCurrent () |
int | getId () |
std::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 |
std::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 | ( | std::string | name, |
ElementType | type, | ||
double | value | ||
) |
Definition at line 33 of file Element.cpp.
References current, CURRENT_SOURCE_traction_wire, isenabled, name, nNode, pNode, powerWanted, resistance, RESISTOR_traction_wire, TL, type, voltage, VOLTAGE_SOURCE_traction_wire, and WRITE_ERRORF.
double Element::getCurrent | ( | ) |
Definition at line 85 of file Element.cpp.
References current, CURRENT_SOURCE_traction_wire, getVoltage(), isenabled, resistance, RESISTOR_traction_wire, type, and VOLTAGE_SOURCE_traction_wire.
Referenced by Circuit::getCurrent(), getPower(), and MSTractionSubstation::solveCircuit().
int Element::getId | ( | ) |
Definition at line 108 of file Element.cpp.
References id.
std::string Element::getName | ( | ) |
Definition at line 122 of file Element.cpp.
References name.
Referenced by MSDevice_ElecHybrid::notifyMove().
Node * Element::getNegNode | ( | ) |
Definition at line 115 of file Element.cpp.
References nNode.
Referenced by Circuit::eraseElement(), MSDevice_ElecHybrid::notifyMove(), and MSOverheadWire::~MSOverheadWire().
Node * Element::getPosNode | ( | ) |
Definition at line 112 of file Element.cpp.
References pNode.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit(), Circuit::eraseElement(), MSDevice_ElecHybrid::notifyMove(), and MSOverheadWire::~MSOverheadWire().
double Element::getPower | ( | ) |
Definition at line 105 of file Element.cpp.
References getCurrent(), and getVoltage().
Referenced by Circuit::getTotalPowerOfCircuitSources().
double Element::getPowerWanted | ( | ) |
Definition at line 102 of file Element.cpp.
References powerWanted.
Referenced by MSDevice_ElecHybrid::getPowerWanted(), and MSDevice_ElecHybrid::notifyMove().
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().
Definition at line 138 of file Element.cpp.
Referenced by Circuit::deployResults().
Element::ElementType Element::getType | ( | ) |
Definition at line 119 of file Element.cpp.
References type.
Referenced by Circuit::addElement(), and getVoltage().
double Element::getVoltage | ( | ) |
Definition at line 76 of file Element.cpp.
References getType(), Node::getVoltage(), isenabled, nNode, pNode, voltage, and VOLTAGE_SOURCE_traction_wire.
Referenced by getCurrent(), getPower(), Circuit::getVoltage(), and MSTractionSubstation::solveCircuit().
bool Element::isEnabled | ( | ) |
Definition at line 148 of file Element.cpp.
References isenabled.
void Element::setCurrent | ( | double | current | ) |
Definition at line 63 of file Element.cpp.
References current.
Referenced by MSDevice_ElecHybrid::notifyMove().
void Element::setEnabled | ( | bool | isenabled | ) |
Definition at line 152 of file Element.cpp.
References isenabled.
void Element::setId | ( | int | id | ) |
Definition at line 133 of file Element.cpp.
Referenced by Circuit::addElement(), MSDevice_ElecHybrid::deleteVehicleFromCircuit(), and Circuit::replaceAndDeleteNode().
void Element::setNegNode | ( | Node * | node | ) |
Definition at line 130 of file Element.cpp.
References nNode.
Referenced by Circuit::addElement().
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().
void Element::setPowerWanted | ( | double | powerWanted | ) |
Definition at line 73 of file Element.cpp.
References powerWanted.
Referenced by MSDevice_ElecHybrid::notifyMove().
void Element::setResistance | ( | double | resistance | ) |
Definition at line 66 of file Element.cpp.
References resistance.
Referenced by MSDevice_ElecHybrid::notifyMove().
void Element::setType | ( | ElementType | ET | ) |
Definition at line 156 of file Element.cpp.
References type.
void Element::setVoltage | ( | double | voltage | ) |
Definition at line 60 of file Element.cpp.
References voltage.
|
private |
Definition at line 64 of file Element.h.
Referenced by Element(), getCurrent(), and setCurrent().
|
private |
Definition at line 70 of file Element.h.
Referenced by Element(), getCurrent(), getVoltage(), isEnabled(), and setEnabled().
|
private |
|
private |
Definition at line 62 of file Element.h.
Referenced by Element(), getNegNode(), getTheOtherNode(), getVoltage(), and setNegNode().
|
private |
Definition at line 61 of file Element.h.
Referenced by Element(), getPosNode(), getTheOtherNode(), getVoltage(), and setPosNode().
|
private |
Definition at line 66 of file Element.h.
Referenced by Element(), getPowerWanted(), and setPowerWanted().
|
private |
Definition at line 65 of file Element.h.
Referenced by Element(), getCurrent(), getResistance(), and setResistance().
|
private |
|
private |
Definition at line 63 of file Element.h.
Referenced by Element(), getVoltage(), and setVoltage().