Skip to content

Commit

Permalink
Round 2 of evaluating MountainGoat on the supercomputer
Browse files Browse the repository at this point in the history
  • Loading branch information
squeeglepoof committed Aug 29, 2016
1 parent ca5ee47 commit dee0d7a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/learning/src/MG_SecondAttempt.json
Expand Up @@ -36,7 +36,7 @@
"monteCarlo" : true,
"numberOfStates" : 0,
"numberOfOutputs" : 2,
"numberOfInstances" : 100,
"numberOfInstances" : 392,
"populationSize" : 5000,
"useAverage" : true,
"numberToMutate" : 2,
Expand Down
5 changes: 3 additions & 2 deletions src/dev/bgigous/MG_SecondAttempt/AppQuadSimpleActuation.cpp
Expand Up @@ -116,7 +116,7 @@ bool AppQuadSimpleActuation::setup()
const double impedanceMax = 2000.0;

const int segmentSpan = 3; //Not sure what this will be for mine!
const int numMuscles = 8; //This may be ok, but confirm.
const int numMuscles = 16; //This may be ok, but confirm.
const int numParams = 2;
const int segNumber = 0; // For learning results
const double controlTime = .01;
Expand Down Expand Up @@ -175,7 +175,7 @@ bool AppQuadSimpleActuation::setup()
maxH,
minH);
/// @todo fix memory leak that occurs here
JSONQuadFeedbackControl* const myControl =
myControl =
new JSONQuadFeedbackControl(control_config, suffix, lowerPath);

#if (0)
Expand Down Expand Up @@ -347,6 +347,7 @@ bool AppQuadSimpleActuation::run()
delete simulation;
delete view;
delete world;
delete myControl;

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/dev/bgigous/MG_SecondAttempt/AppQuadSimpleActuation.h
Expand Up @@ -90,6 +90,7 @@ class AppQuadSimpleActuation
tgWorld* world;
tgSimView* view;
tgSimulation* simulation;
JSONQuadFeedbackControl * myControl;

bool use_graphics;
bool add_controller;
Expand Down
11 changes: 11 additions & 0 deletions src/dev/bgigous/MG_SecondAttempt/BigPuppySymmetricSpiral2.cpp
Expand Up @@ -554,6 +554,17 @@ void BigPuppySymmetricSpiral2::addMuscles(tgStructure& puppy){
puppy.addPair(n6[3], n13[0], tgString("left front leg_to spine middle muscleAct seg", 11) + tgString(" seg", 7));
puppy.addPair(n0[2], n14[0], tgString("left hind leg_to spine middle muscleAct seg", 11) + tgString(" seg", 7));

puppy.addPair(n13[5], n9[2], tgString("left front leg_to extra muscleAct seg", 13) + tgString(" seg", 9));
puppy.addPair(n13[5], n9[3], tgString("left front leg_to extra muscleAct seg", 13) + tgString(" seg", 9));

puppy.addPair(n11[5], n7[2], tgString("right front leg_to inner extra muscleAct seg", 11) + tgString(" seg", 7));
puppy.addPair(n11[5], n7[3], tgString("right front leg_to inner extra muscleAct seg", 11) + tgString(" seg", 7));

puppy.addPair(n12[5], n8[2], tgString("right hind leg_to extra muscleAct seg", 12) + tgString(" seg", 8));
puppy.addPair(n12[5], n8[3], tgString("right hind leg_to extra muscleAct seg", 12) + tgString(" seg", 8));

puppy.addPair(n14[5], n10[2], tgString("left hind leg_to extra muscleAct seg", 14) + tgString(" seg", 10));
puppy.addPair(n14[5], n10[3], tgString("left hind leg_to extra muscleAct seg", 14) + tgString(" seg", 10));
//puppy.addPair(n14[5], n10[2], tgString("left_hind_leg extra muscle seg", 14) + tgString(" seg", 10));
//puppy.addPair(n14[5], n10[3], tgString("left_hind_leg extra muscle seg", 14) + tgString(" seg", 10));
//Populate feet with muscles. Todo: think up names to differentiate each!
Expand Down
9 changes: 5 additions & 4 deletions src/dev/bgigous/MG_SecondAttempt/JSONQuadFeedbackControl.cpp
Expand Up @@ -233,10 +233,11 @@ void JSONQuadFeedbackControl::onStep(BaseSpineModelLearning& subject, double dt)
m_updateTime = 0;
}

double currentHeight = subject.getSegmentCOM(m_config.segmentNumber)[1];

/// Max and min heights added to config
if (currentHeight > m_config.maxHeight || currentHeight < m_config.minHeight)
double currentHeight = subject.getSegmentCOM(m_config.segmentNumber)[1];
double currentHeightTail = subject.getSegmentCOM(6)[1];
/// Max and min heights added to config
if (currentHeight > m_config.maxHeight || currentHeight < m_config.minHeight
|| currentHeightTail > m_config.maxHeight || currentHeightTail < m_config.minHeight)
{
/// @todo if bogus, stop trial (reset simulation)
bogus = true;
Expand Down

0 comments on commit dee0d7a

Please sign in to comment.