public void place_agent() { if (!this.exists_free_space()) { throw new ArgumentException("There is no free spot in maze"); } do { this.X = Utils.Rnd.Next(0, Width); this.Y = Utils.Rnd.Next(0, Height); } while (!this.Accessible(this.X,this.Y)); }