Esempio n. 1
0
//----------------------------------------------------------------------------------------------------------------------    
void CTRNN::record(Recorder& recorder)
{
  for(int i = 0; i < size; ++i)
  {
    recorder.push_back("NeuralInput" + toString(i), inputs[i]);
    recorder.push_back("NeuralState" + toString(i), states[i]);
    recorder.push_back("NeuralOutput" + toString(i), outputs[i]);
    recorder.push_back("NeuralExtInput" + toString(i), externalinputs[i]);
  }
}
Esempio n. 2
0
//----------------------------------------------------------------------------------------------------------------------  
void SMCAgent::record(Recorder& recorder)
{
  recorder.push_back("PosX", m_position[0]);  
  recorder.push_back("PosY", m_position[1]);
  recorder.push_back("VelX", m_velocity[0]);  
  recorder.push_back("VelY", m_velocity[1]);  
  recorder.push_back("Angle", m_angle);  
  recorder.push_back("AngularSpeed", m_angularSpeed);
  recorder.push_back("Sensor", m_sensedValue);  
  recorder.push_back("SensorDer", m_sensedValueDerivative);
  recorder.push_back("Energy", m_energy);
  recorder.push_back("SensedEnergy", getSensedEnergy());
  recorder.push_back("Food", m_food);
  recorder.push_back("Time", m_time);
  
  // ctrnn
  m_ctrnn->record(recorder);
}  
Esempio n. 3
0
//----------------------------------------------------------------------------------------------------------------------    
void Muscle::record(Recorder& recorder)
{
  recorder.push_back(m_name + "LengthNorm", m_lengthNorm);
  recorder.push_back(m_name + "VelocityNorm", m_velocityNorm);
  recorder.push_back(m_name + "Act", m_activation);
  recorder.push_back(m_name + "FrcPsv", m_passiveForceNorm);
  recorder.push_back(m_name + "FrcAct", m_activeForceNorm);
  recorder.push_back(m_name + "FrcVel", m_velocityForceNorm);
  recorder.push_back(m_name + "Force", m_force);
  
  if(m_isMonoArticulate)
  {
    double ma = ((MuscleMonoWrap*)this)->getMomentArm();
    recorder.push_back(m_name + "MomentArm", ma);
    recorder.push_back(m_name + "Torque", ma * m_force);
  }
  else 
  {
    double maElb = ((MuscleBiWrap*)this)->getMomentArm(JT_elbow);
    double maShd = ((MuscleBiWrap*)this)->getMomentArm(JT_shoulder);
    recorder.push_back(m_name + "MomentArmElb", maElb);
    recorder.push_back(m_name + "MomentArmShd", maShd);
    recorder.push_back(m_name + "TorqueElb", maElb * m_force);
    recorder.push_back(m_name + "TorqueShd", maShd * m_force);
  }

}