fixGrid()
  {
    for (var r = 0; r < this.graph.rowCount; r++)
    {
      for (var c = 0; c < this.graph.columnCount; c++)
      {
        var box = this.getBox(r,c),
            x = box.nodeType;
        box.isVisited = false;

        box.resetText(); //  HERE

        if(x !== states.BOX_TYPES.START_NODE && x !== states.BOX_TYPES.END_NODE)
          {
            if (x == states.BOX_TYPES.BLOCK || x == states.BOX_TYPES.ERROR_NODE)
            {
              this.setBlock(r, c);
            }

            else if(x == states.BOX_TYPES.WEIGHT_NODE)
            {
              this.setWeight(r,c);
            }

            else if(x == states.BOX_TYPES.STATION_NODE)
            {
              box.setAsStation();
            }

            else
            {
              this.setClear(r, c);
            }
          }
      }
    }
  }
/*
    Ensures that everything is as it should be before starting the search
  */
Ensures that everything is as it should be before starting the search
Ensures that everything is as it should be before starting the search
fixGrid()
  {
    for (var r = 0; r < this.graph.rowCount; r++)
    {
      for (var c = 0; c < this.graph.columnCount; c++)
      {
        var box = this.getBox(r,c),
            x = box.nodeType;
        box.isVisited = false;
        box.resetText(); 
        if(x !== states.BOX_TYPES.START_NODE && x !== states.BOX_TYPES.END_NODE)
          {
            if (x == states.BOX_TYPES.BLOCK || x == states.BOX_TYPES.ERROR_NODE)
            {
              this.setBlock(r, c);
            }
            else if(x == states.BOX_TYPES.WEIGHT_NODE)
            {
              this.setWeight(r,c);
            }
            else if(x == states.BOX_TYPES.STATION_NODE)
            {
              box.setAsStation();
            }
            else
            {
              this.setClear(r, c);
            }
          }
      }
    }
  }
fixGrid ( ) { for ( var r = 0 ; r < this . graph . rowCount ; r ++ ) { for ( var c = 0 ; c < this . graph . columnCount ; c ++ ) { var box = this . getBox ( r , c ) , x = box . nodeType ; box . isVisited = false ; box . resetText ( ) ; if ( x !== states . BOX_TYPES . START_NODE && x !== states . BOX_TYPES . END_NODE ) { if ( x == states . BOX_TYPES . BLOCK || x == states . BOX_TYPES . ERROR_NODE ) { this . setBlock ( r , c ) ; } else if ( x == states . BOX_TYPES . WEIGHT_NODE ) { this . setWeight ( r , c ) ; } else if ( x == states . BOX_TYPES . STATION_NODE ) { box . setAsStation ( ) ; } else { this . setClear ( r , c ) ; } } } } }
Ensures that everything is as it should be before starting the search
Ensures that everything is as it should be before starting the search
//  HERE
