41 return m_x+item().x();
46 return m_y+item().y();
49 void Port::moveTo(
float x,
float y)
57 return m_item.group.lock();
60 void Port::eraseWire(
Wire* w)
62 for (
auto i=m_wires.begin(); i!=m_wires.end(); ++i)
70 void Port::deleteWires()
73 if (
auto g=item().
group.lock())
75 auto& gg=g->globalGroup();
77 vector<WirePtr> wireHold;
78 wireHold.reserve(wires.size());
80 wireHold.push_back(gg.removeWire(*w));
86 void PortExclude::setVariableValue(
const std::shared_ptr<VariableValue>& v) {
92 double Port::value()
const {
96 for (
auto* w: m_wires)
97 combineInput(r, w->from()->value());
100 auto vv=getVariableValue();
101 if (vv && vv->type()!=VariableType::undefined)
103 return item().value();
109 if (!wires().empty())
110 return wires()[0]->units(check);
114 shared_ptr<VariableValue> PortExclude::getVariableValue()
const {
115 if (
input() && !m_wires.empty())
116 return m_wires[0]->from()->getVariableValue();
117 return variableValue.lock();
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
represents the units (in sense of dimensional analysis) of a variable.
std::shared_ptr< Group > GroupPtr
CLASSDESC_ACCESS_EXPLICIT_INSTANTIATION(minsky::Port)