src/mlpack/tests/rl_components_test.cpp
BOOST_AUTO_TEST_CASE(SimpleContinuousMountainCarTest)
{
  const ContinuousMountainCar task = ContinuousMountainCar();

  ContinuousMountainCar::State state = task.InitialSample();
  ContinuousMountainCar::Action action;
  action.action[0] = math::Random(-1.0, 1.0);
  double reward = task.Sample(state, action);
  // Maximum reward possible is 100.
  BOOST_REQUIRE(reward <= 100.0);
  BOOST_REQUIRE(!task.IsTerminal(state));
  BOOST_REQUIRE_EQUAL(1, action.size);
}
/**
 * Constructs a Continuous MountainCar instance and check if the main rountine 
 * works as it should be.
 */
Constructs a Continuous MountainCar instance and check if the main rountine
works as it should be.
Constructs a Continuous MountainCar instance and check if the main rountine works as it should be .
BOOST_AUTO_TEST_CASE(SimpleContinuousMountainCarTest)
{
  const ContinuousMountainCar task = ContinuousMountainCar();
  ContinuousMountainCar::State state = task.InitialSample();
  ContinuousMountainCar::Action action;
  action.action[0] = math::Random(-1.0, 1.0);
  double reward = task.Sample(state, action);
  BOOST_REQUIRE(reward <= 100.0);
  BOOST_REQUIRE(!task.IsTerminal(state));
  BOOST_REQUIRE_EQUAL(1, action.size);
}
BOOST_AUTO_TEST_CASE ( SimpleContinuousMountainCarTest ) { const ContinuousMountainCar task = ContinuousMountainCar ( ) ; ContinuousMountainCar :: State state = task . InitialSample ( ) ; ContinuousMountainCar :: Action action ; action . action [ 0 ] = math :: Random ( -1.0 , 1.0 ) ; double reward = task . Sample ( state , action ) ; BOOST_REQUIRE ( reward <= 100.0 ) ; BOOST_REQUIRE ( ! task . IsTerminal ( state ) ) ; BOOST_REQUIRE_EQUAL ( 1 , action . size ) ; }
Constructs a Continuous MountainCar instance and check if the main rountine
 works as it should be.
Constructs a Continuous MountainCar instance and check if the main rountine works as it should be .
// Maximum reward possible is 100.