void ribi::kalman::StandardWhiteNoiseSystem::GoToNextState()
{
  //Create a no-input vector
  const auto sz = GetCurrentState().size();
  boost::numeric::ublas::vector<double> input(sz,0.0);
  return GoToNextState(input);
}
//---------------------------------------------------------------------------
void ribi::gtst::ServerStateChooseAction::OnTimer()
{
  if (CanGoToNextState())
  {
    GoToNextState();
  }
}
//---------------------------------------------------------------------------
void ribi::gtst::ServerStateGroupAssign::OnTimer()
{
  if (CanGoToNextState())
  {
    GetServer()->GetGroups()->MoveLoggedInToParticipating();
    GoToNextState();
  }
}
//---------------------------------------------------------------------------
void ServerStateGroupReAssign::OnTimer()
{
  if (CanGoToNextState())
  {
    //Actually move the Participants
    const Group * const most_successful_group = m_worst_and_best_group.second;
    //Get the group size of the group with the highest payoffs
    const int group_size = most_successful_group->GetSize();

    if (group_size == 3)
    {
      std::clog << "A group of size 3 grows to 5!\n";
      NotifyGroupGrowth(most_successful_group);
    }
    else if (group_size == 5)
    {
      std::clog << "A group of size 5 splits!\n";
      const Group * const least_successful_group = m_worst_and_best_group.first;
      assert(least_successful_group);
      assert(least_successful_group != most_successful_group);

      ///\note
      ///The operation below invalidates const Group * const least_successful_group
      NotifyKillGroup(least_successful_group);
      //Again find the most successful group and let it split
      //Find the group with the highest payoff
      assert(most_successful_group->GetSize() == 5);

      NotifyGroupSplit(most_successful_group);
    }

    GoToNextState();

  }


}
void ribi::gtst::ServerStateViewResultsVoting::OnTimer()
{
  if (CanGoToNextState()) GoToNextState();
}
//---------------------------------------------------------------------------
void ribi::gtst::ServerStateChat::OnTimer()
{
  if (CanGoToNextState()) GoToNextState();
}
//---------------------------------------------------------------------------
void ServerStateVoting::OnTimer()
{
  if (CanGoToNextState()) GoToNextState();
}