Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jegp/pfp-draigana
https://github.com/jegp/pfp-draigana
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jegp/pfp-draigana
- Owner: Jegp
- License: gpl-3.0
- Created: 2017-12-11T14:58:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-18T19:34:23.000Z (about 7 years ago)
- Last Synced: 2024-10-28T12:59:48.534Z (about 2 months ago)
- Language: Haskell
- Size: 216 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Draigana
Author: xtp778
The code is tested using ``hspec`` and I chose a board
representation using ``Data.Sequence`` which has faster lookup and tail
operation times.In my solution I have implemented basic ``forkIO`` lightweight thread
parallelism. For each possible moves in a given board, a lightweight thread is
spawned. The thread spawning the sub-threads wait until all the sub-threads
have returned (using a ``QSemN``). If that happens and more time is left,
the minimax depth is doubled, and the threads are started again.
The attached image shows that all (4) threads are utilised, but
that there are a lot of pausing. This is probably due to the semaphore
implementation, where the threads are forced to wait for each other. A different
approach could be to use an ``STM`` monad to calculate the heuristics
recursively. If done recursively, each calculation can be evaluated against
each other without forcing other threads to wait.Due to time limitations I have not attempted to implement this.
![GitHub Logo](play-par.png)
Figure 1. Screenshot of a brief ``play-par`` run.Note: while I respect the idea of having a competition, I think
it's a shame we don't have more time to develop the solution. I have only been
able to use the normalised 20 hours on this assignment.