-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a __setitem__ method in PrimitiveTree to check user input. Curr…
…ently, these verifications cover three common errors : - Replacing a primitive by another of a different arity - Appending a subtree to the end without changing the current primitives (this will lead to an "unaccessible" part of the tree, meaning that len(ind) will return a different value than len(ind[ind.searchSubtree(0)]), and that some part of the tree will _not_ be evaluated, which can be seriously misleading) - Inserting an incomplete subtree, for instance [add, 1, 2, 3] (considering that add has an arity of 2), which would mess up the tree A quick testing shows virtually no performance loss over the previous (non-checked) method. Also fix a small bug in the C version of the Ant simulator. --HG-- branch : dev
- Loading branch information
marc.andre.gardner
committed
Jul 16, 2012
1 parent
d59c2e5
commit ff0c6ad
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from distutils.core import setup, Extension | ||
|
||
module1 = Extension('cAnt', | ||
module1 = Extension('AntC', | ||
sources = ['AntSimulatorFast.cpp']) | ||
|
||
setup (name = 'cAnt', | ||
setup (name = 'AntC', | ||
version = '1.0', | ||
description = 'Fast version of the Ant Simulator (aims to replace the AntSimulator class)', | ||
ext_modules = [module1]) |