![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <Circuit.h>
Public Member Functions | |
Element * | addElement (string name, double value, Node *pNode, Node *nNode, Element::ElementType et) |
Node * | addNode (string name) |
bool | checkCircuit (std::string substationId="") |
Circuit () | |
void | cleanUpSP () |
void | descreaseLastId () |
void | eraseElement (Element *element) |
void | eraseNode (Node *node) |
double | getCurrent (string name) |
vector< Element * > * | getCurrentSources () |
Element * | getElement (string name) |
int | getLastId () |
Node * | getNode (int id) |
Node * | getNode (string name) |
int | getNumVoltageSources () |
double | getResistance (string name) |
double | getVoltage (string name) |
Element * | getVoltageSource (int id) |
void | lock () |
void | replaceAndDeleteNode (Node *unusedNode, Node *newNode) |
void | unlock () |
Data Fields | |
double | alphaBest |
Best alpha scaling value. More... | |
Private Member Functions | |
void | deployResults (double *vals, std::vector< int > *removable_ids) |
void | detectRemovableNodes (std::vector< int > *removable_ids) |
Element * | getElement (int id) |
Private Attributes | |
vector< Element * > * | elements |
bool | iscleaned |
int | lastId |
vector< Node * > * | nodes |
vector< Element * > * | voltageSources |
Circuit::Circuit | ( | ) |
Definition at line 492 of file Circuit.cpp.
Element * Circuit::addElement | ( | string | name, |
double | value, | ||
Node * | pNode, | ||
Node * | nNode, | ||
Element::ElementType | et | ||
) |
Definition at line 659 of file Circuit.cpp.
References Node::addElement(), circuit_lock, Element::getType(), Element::setId(), Element::setNegNode(), and Element::setPosNode().
Referenced by MSTractionSubstation::addOverheadWireClampToCircuit(), MSTractionSubstation::addOverheadWireInnerSegmentToCircuit(), MSTractionSubstation::addOverheadWireSegmentToCircuit(), and MSDevice_ElecHybrid::notifyMove().
Node * Circuit::addNode | ( | string | name | ) |
Definition at line 41 of file Circuit.cpp.
References circuit_lock, and Node::setGround().
Referenced by MSTractionSubstation::addOverheadWireInnerSegmentToCircuit(), MSTractionSubstation::addOverheadWireSegmentToCircuit(), and MSDevice_ElecHybrid::notifyMove().
bool Circuit::checkCircuit | ( | std::string | substationId = "" | ) |
there used to be == 1 which was probably a typo ... check!
Definition at line 764 of file Circuit.cpp.
References Node::getElements(), Node::getId(), Node::isGround(), toString(), WRITE_ERROR, and WRITE_WARNING.
void Circuit::cleanUpSP | ( | ) |
Definition at line 751 of file Circuit.cpp.
|
private |
Definition at line 401 of file Circuit.cpp.
References Node::getAnOtherElement(), Element::getResistance(), Element::getTheOtherNode(), Node::getVoltage(), Node::isRemovable(), Node::setVoltage(), and WRITE_ERROR.
|
inline |
Definition at line 178 of file Circuit.h.
References lastId.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit().
|
private |
Definition at line 638 of file Circuit.cpp.
void Circuit::eraseElement | ( | Element * | element | ) |
Definition at line 693 of file Circuit.cpp.
References circuit_lock.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit(), and MSOverheadWire::~MSOverheadWire().
void Circuit::eraseNode | ( | Node * | node | ) |
Definition at line 62 of file Circuit.cpp.
References circuit_lock.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit(), and MSOverheadWire::~MSOverheadWire().
double Circuit::getCurrent | ( | string | name | ) |
Definition at line 68 of file Circuit.cpp.
References Element::getCurrent().
vector< Element * > * Circuit::getCurrentSources | ( | ) |
Definition at line 154 of file Circuit.cpp.
Referenced by MSTractionSubstation::solveCircuit().
|
private |
Definition at line 131 of file Circuit.cpp.
Element * Circuit::getElement | ( | string | name | ) |
Definition at line 117 of file Circuit.cpp.
Referenced by MSDevice_ElecHybrid::notifyMove().
|
inline |
Definition at line 173 of file Circuit.h.
References lastId.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit().
Node * Circuit::getNode | ( | int | id | ) |
Definition at line 108 of file Circuit.cpp.
Node * Circuit::getNode | ( | string | name | ) |
Definition at line 98 of file Circuit.cpp.
Referenced by MSTractionSubstation::addOverheadWireSegmentToCircuit(), MSDevice_ElecHybrid::deleteVehicleFromCircuit(), GUIOverheadWire::drawGL(), and MSDevice_ElecHybrid::notifyMove().
int Circuit::getNumVoltageSources | ( | ) |
Definition at line 841 of file Circuit.cpp.
double Circuit::getResistance | ( | string | name | ) |
Definition at line 90 of file Circuit.cpp.
References Element::getResistance().
double Circuit::getVoltage | ( | string | name | ) |
Definition at line 76 of file Circuit.cpp.
References Element::getVoltage(), and Node::getVoltage().
Element * Circuit::getVoltageSource | ( | int | id | ) |
Definition at line 145 of file Circuit.cpp.
Referenced by MSDevice_ElecHybrid::deleteVehicleFromCircuit().
void Circuit::lock | ( | ) |
Definition at line 165 of file Circuit.cpp.
References circuit_lock.
Definition at line 701 of file Circuit.cpp.
References Node::addElement(), Node::eraseElement(), Node::getId(), Element::setId(), Node::setId(), and WRITE_ERROR.
Referenced by MSTractionSubstation::addOverheadWireSegmentToCircuit().
void Circuit::unlock | ( | ) |
Definition at line 169 of file Circuit.cpp.
References circuit_lock.
double Circuit::alphaBest |
Best alpha scaling value.
This parameter is used to scale down the power demands of current sources (vehicles that draw power from the circuit) so that a solution of the system can be found. Note: the system is nonlinear (quadratic), hence in some cases (typically too high power demands) a solution cannot be found. In that moment we decrease all power requirements by alpha
and try to solve again, until we find alpha that ensures stable solution. This is then reported as alphaBest.
Definition at line 69 of file Circuit.h.
Referenced by MSDevice_ElecHybrid::getCircuitAlpha(), and MSTractionSubstation::solveCircuit().
|
private |
Definition at line 46 of file Circuit.h.
Referenced by descreaseLastId(), and getLastId().