41 m_nodeNumber(nodeNum),
44 frequencyOffset(params[0]),
45 frequencyScale(params[1]),
46 radiusOffset(params[2]),
47 radiusScale(params[3]),
52 assert(params.size() >= 7);
60 void CPGNode::addCoupling(
CPGNode* cNode,
64 couplingList.push_back(cNode);
65 weightList.push_back(cWeight);
66 phaseList.push_back(cPhase);
68 assert(couplingList.size() == weightList.size() && couplingList.size() == phaseList.size());
73 phiDotValue = 2 * M_PI *
nodeEquation(descCom, frequencyOffset, frequencyScale);
80 const std::size_t n = couplingList.size();
81 for (std::size_t i = 0; i != n; i++){
82 const CPGNode& targetNode = *(couplingList[i]);
83 phiDotValue += weightList[i] * targetNode.rValue * sin (targetNode.phiValue - phiValue - phaseList[i]);
87 - rValue) - rDotValue);
95 if(d >= dMin && d <= dMax){
103 void CPGNode::updateNodeValues (
double newPhi,
114 std::string CPGNode::toString(
const std::string& prefix)
const
117 std::ostringstream os;
118 os << prefix <<
"CPGNode(" << p <<
m_nodeNumber << std::endl;
122 os << prefix << p <<
"Connectivity:" << std::endl;
123 for(
int i = 0; i < couplingList.size(); i++) {
124 os << prefix << p << p << *(couplingList[i]);
double nodeEquation(double d, double c0, double c1)
Definition of class CPGNode.
CPGNode(int nodeNum, const std::vector< double > ¶ms)
virtual void updateDTs(double descCom)