Class Sachovnice

java.lang.Object
  extended by Sachovnice

public class Sachovnice
extends java.lang.Object

Class Sachovnice solves Eight queen puzzle by means of hill-climbing algorithm.

Version:
Author:
Martin Řehánek, 143357@mail.muni.cz

Constructor Summary
Sachovnice()
          Nonparametric constructor for objects of class Sachovnice that creates random chessboard.
Sachovnice(Pozice[] damy)
          Constructor for objects of class Sachovnice.
 
Method Summary
 Stav getRandomLowest(java.util.SortedSet<Stav> stavy)
          Returns one of the stav that has lowest number of conflicts (it chooses randomly among more items with same number of conflicts)
static void main()
          Solves two chosen chessboard setting and one random setting.
 java.lang.String toString()
          Returns a string representation of the object.
 void Vyres(boolean vypisy, int maxCounter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Sachovnice

public Sachovnice()
Nonparametric constructor for objects of class Sachovnice that creates random chessboard.


Sachovnice

public Sachovnice(Pozice[] damy)
Constructor for objects of class Sachovnice.

Parameters:
damy - Array of objects of class Pozice that represent positions of queens.
Method Detail

getRandomLowest

public Stav getRandomLowest(java.util.SortedSet<Stav> stavy)
Returns one of the stav that has lowest number of conflicts (it chooses randomly among more items with same number of conflicts)

Returns:
one of the stav that has lowest number of conflicts

main

public static void main()
Solves two chosen chessboard setting and one random setting.


toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.

Vyres

public void Vyres(boolean vypisy,
                  int maxCounter)