Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
TakefujiLee.h
Go to the documentation of this file.
1 
4 // MIT License
5 //
6 // Copyright (c) 2019 Ian Parberry
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 
26 #ifndef __TakefujiLee__
27 #define __TakefujiLee__
28 
29 #include "NeuralNet.h"
30 #include "Includes.h"
31 #include "Board.h"
32 
46 
47 class CTakefujiLee: public CNeuralNet{
48  private:
49  int m_nWidth = 0;
50  int m_nHeight = 0;
51  int m_nSize = 0;
52 
53  bool Update();
54  void GetAdjacentVertices(std::vector<CVertex*>& v,
55  CVertex* p);
56  bool IsStable();
57  bool HasDegree2();
58  void Reset();
59  void RandomizeEdgeList();
60  void GraphToBoard(CBoard& b);
61 
62  public:
63  CTakefujiLee(int w, int h, int seed);
64 
65  void Generate(CBoard& b);
66 }; //CTakefujiLee
67 
68 #endif
bool IsStable()
Stability test.
bool HasDegree2()
Degree test.
void GraphToBoard(CBoard &b)
Convert graph to board.
int m_nWidth
Board width.
Definition: TakefujiLee.h:49
Useful includes.
int m_nHeight
Board height.
Definition: TakefujiLee.h:50
Header for CNeuralNet and its edges CNeuron.
Hopfield network.
Definition: NeuralNet.h:64
void GetAdjacentVertices(std::vector< CVertex * > &v, CVertex *p)
Get adjacent vertices.
CTakefujiLee(int w, int h, int seed)
Constructor.
Definition: TakefujiLee.cpp:41
Neural network tourney generator.
Definition: TakefujiLee.h:47
int m_nSize
Board size.
Definition: TakefujiLee.h:51
Graph vertex.
Definition: Graph.h:70
Chessboard.
Definition: Board.h:42
bool Update()
Update all neurons.
Definition: TakefujiLee.cpp:83
Header for the chessboard CBoard.
void Reset()
Reset.
Definition: TakefujiLee.cpp:70
void Generate(CBoard &b)
Generate a tourney.
void RandomizeEdgeList()
Randomize the edge list.