Here's a description of Patsolve's prioritization algorithm that I wrote
by inspecting the code. Next, I plan to implement it inside Freecell
Solver.
Regards,
Shlomi Fish
mp->fromtype == W_TYPE :
line 654 : moving a card from a filled column
line 734 : moving a card from a filled stack
line 764 : moving a card from a filled stack
line 842 : moving a card from a filled stack
if moving a card from a filled column:
Increase the priority by Xparam[0] for every card we need that
appears in this column.
Card we need: card that should be put in the foundations next or
the next card afterwards.
Increase the priority by Xparam[1] if the card that is one card
below the top of the column (i.e: right under the card that is moved)
is immediately needed for the foundations.
If moving a card to a filled column:
Decrease the priority by Xparam[2] for each card we need under the
target column.
Assign initial priority:
- for a move from the top of a column to the foundations - 0
- for a move from the freecells to the foundations - 0
- a move from a 2+ card column to an empty column - Xparam[3]
- a move from column to the top of a filled column - Xparam[4]
- a move from the freecells to a non-empty column - Xparam[5]
- a move from a freecell to an empty column - Xparam[6]
- a move from a column to a freecell - Xparam[7]
Irreversible moves:
The priority of an irreversible move is increased by Xparam[8]
Number of cards out:
The priority of the position itself is increased by
Yparam[0] * nout^2 + Yparam[1] * nout + Yparam[2] (rounded to the nearest
integer).
Priority Handling:
In patsolve a priority less than 0 is mapped to 0, and a priority above
the number of queues is mapped to the number of the maximal queue.
----------------------------------------------------------------------
Shlomi Fish shlomif_at_t2.technion.ac.il
Home Page:
http://t2.technion.ac.il/~shlomif/
There's no point in keeping an idea to yourself since there's a 10 to 1
chance that somebody already has it and will share it before you.
Received on Tue Aug 26 2003 - 07:32:37 IDT