src/cellar.cpp
/*
	The Grid exists for consistency across start states.  This way multiple (starting) instances of the same problem (ie. object location)
can be created.  This is used when creating state samples for belief state.
*/
The Grid exists for consistency across start states.  This way multiple (starting) instances of the same problem
can be created.  This is used when creating state samples for belief state.
The Grid exists for consistency across start states . This way multiple ( starting ) instances of the same problem can be created . This is used when creating state samples for belief state .
void CELLAR::InitGeneral()
{
    HalfEfficiencyDistance = 20;
    StartPos = COORD(0, Size / 2);
    RandomSeed(0);
    Grid.SetAllValues(-1);
    for (int i = 0; i < NumBottles; ++i)
    {
        COORD pos;
        do
        {
            pos = COORD(Random(Size), Random(Size));
        }
        while (Grid(pos) >= 0);
        Grid(pos) = i;
        BottlePos.push_back(pos);
    }
	 for (int i = 0; i < NumObjects; ++i)
    {
      COORD pos;
      do
      {
          pos = COORD(Random(Size), Random(Size));
      }
      while (Grid(pos) != -1 || pos == StartPos);
      if(i < NumShelves)
			Grid(pos) = 100+E_SHELF;
		else
			Grid(pos) = 100+E_CRATE;
		ObjectPos.push_back(pos);
    }
}
void CELLAR :: InitGeneral ( ) { HalfEfficiencyDistance = 20 ; StartPos = COORD ( 0 , Size / 2 ) ; RandomSeed ( 0 ) ; Grid . SetAllValues ( -1 ) ; for ( int i = 0 ; i < NumBottles ; ++ i ) { COORD pos ; do { pos = COORD ( Random ( Size ) , Random ( Size ) ) ; } while ( Grid ( pos ) >= 0 ) ; Grid ( pos ) = i ; BottlePos . push_back ( pos ) ; } for ( int i = 0 ; i < NumObjects ; ++ i ) { COORD pos ; do { pos = COORD ( Random ( Size ) , Random ( Size ) ) ; } while ( Grid ( pos ) != -1 || pos == StartPos ) ; if ( i < NumShelves ) Grid ( pos ) = 100 + E_SHELF ; else Grid ( pos ) = 100 + E_CRATE ; ObjectPos . push_back ( pos ) ; } }
The Grid exists for consistency across start states.
The Grid exists for consistency across start states .
//Place Bottles //Place Objects