quoridor | A simple quoridor game server in Rust | Game Engine library
kandi X-RAY | quoridor Summary
kandi X-RAY | quoridor Summary
A quoridor game server implementation in Rust using Iron.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of quoridor
quoridor Key Features
quoridor Examples and Code Snippets
Community Discussions
Trending Discussions on quoridor
QUESTION
Updating this post, once again.
This time to make things clearer.
I am trying, to parse in a Grid of size 9x9, but this size can change overtime, its not fixed. This is a board game called Quoridor. What I have at my disposal, is a Board
class. This provides me with the following, horizontal bool[,]
, and vertical bool[,]
, I can loop over each and print out x, y
position. But these differ, depending on if its horizontal direction, or vertical direction and position.
The player can move one step ONLY either north, south, west, or east in terms of direction. The other player (human) can put a wall (obstacle) which covers two blocks horizontally or vertically. My automated player has to build a Graph of Nodes from the board, and refresh the Graph based on the changes on the board and its own position. For example, if the player cannot go to left, from current position, then an edge which connects two nodes will be deleted between them, only if caused by an obstacle. And then the BFS will run again against the Graph and return a new position (x, y) which this (automated) player uses and performs its move.
Every single block on the 9x9 grid, will represent one Node
in the Graph
. Meaning the number of vertices or nodes List
in the Graph
will be 9x9=81. Each of the Nodes
hold a list
or 2D array
of size 4
for representing North, South, West, and East which could be of a bool
type.
Now, I have provided a sample code of the Graph
class I wrote along with a Node
class. I hope the latest information herein makes it clear. I have already implemented the BFS
algorithm. But this part is what I cannot understand correctly. I watched this video for some ideas: https://www.youtube.com/watch?v=KiCBXu4P-2Y
Code
...ANSWER
Answered 2021-Nov-24 at 22:11Based on what you said I understand your question as follows: How the to handle Nodes that on the edges like (x=0,y=0), (x=9,y=5) or (x=9.y=9) ..... you should handle 8 cases
for case of left top corner the node only have 2 neighbors so set the top and left neighbors Null
QUESTION
I am building an Actor-Critic neural network model in pytorch in order to train an agent to play the game of Quoridor (hopefully). For this reason, I have a neural network with two heads, one for the actor output which does a softmax on all the possible moves and one for the critic output which is just one neuron (for regressing the value of the input state).
Now, in quoridor, most of the times not all moves will be legal and as such I am wondering if I can exclude output neurons on the actor's head that correspond to illegal moves for the input state e.g. by passing a list of indices of all the neurons that correspond to legal moves. Thus, I want to not sum these outputs on the denominator of softmax.
Is there a functionality like this on pytorch (because I cannot find one)? Should I attempt to implement such a Softmax myself (kinda scared to, pytorch probably knows best, I ve been adviced to use LogSoftmax as well)?
Furthermore, do you think this approach of dealing with illegal moves is good? Or should I just let him guess illegal moves and penalize him (negative reward) for it in the hopes that eventually it will not pick illegal moves?
Or should I let the softmax be over all the outputs and then just set illegal ones to zero? The rest won't sum to 1 but maybe I can solve that by plain normalization (i.e. dividing by the L2 norm)?
...ANSWER
Answered 2021-Apr-03 at 18:46An easy solution would be to mask out illegal moves with a large negative value, this will practically force very low (log)softmax values (example below).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install quoridor
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page