A Pen by Riccardo Scalco on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
BOOMR.init({ | |
beacon_url: "/boomerang.gif", | |
BW: { | |
enabled: false | |
} | |
}); | |
BOOMR.subscribe('before_beacon', trackInAnalytics); | |
var pageType = "homepage"; // customize this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a very simple Python 2.7 implementation of the Information Set Monte Carlo Tree Search algorithm. | |
# The function ISMCTS(rootstate, itermax, verbose = False) is towards the bottom of the code. | |
# It aims to have the clearest and simplest possible code, and for the sake of clarity, the code | |
# is orders of magnitude less efficient than it could be made, particularly by using a | |
# state.GetRandomMove() or state.DoRandomRollout() function. | |
# | |
# An example GameState classes for Knockout Whist is included to give some idea of how you | |
# can write your own GameState to use ISMCTS in your hidden information game. | |
# | |
# Written by Peter Cowling, Edward Powley, Daniel Whitehouse (University of York, UK) September 2012 - August 2013. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2016 Google Inc. All Rights Reserved. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
kik (key to index to key) is a new implentation of indexed trie (https://gist.github.com/fbparis/e114958a4a9be84146a1a579cf677e8d) reducing memory footprint by a factor 7 or more! | |
The main differences with indexed tries are: | |
* Trie nodes are no longer stored in Node objects but in a python list. An internal mechanism use the list to simulate a tree behaviour, without any recursive function. | |
* Nodes and values stored in the kik can be compressed with several compression levels: | |
* None: no compression at all | |
* 0: data are stored as pickle.dumps (memory use divided by 3-4) | |
* -1, 1 to 9: pickle.dumps are compressed with zlib | |
* Some internal methods can be cached with a custom implentation of a LRU cache. |