report bug in FunctionSlot – function slots module "pyevolve version 0.6"

14 views
Skip to first unread message

Saeed Soltani Moghadam

unread,
Jul 2, 2017, 11:23:47 AM7/2/17
to pyevolve
It seems there is a bug in "FunctionSlot.FunctionSlot.add(obj, weight)". Suppose that we want to use two selectors with different weights as follows:

ga.selector.set(Selectors.GRankSelector,0.3)
ga.selector.add(Selectors.GRouletteWheel,.7)

here is the output:
>>> ga.printStats
<bound method GSimpleGA.printStats of - GSimpleGA
 GP
Mode: False
 
Population Size: 80
 
Generations: 1000
 
Current Generation: 799
 
Mutation Rate: 0.04
 
Crossover Rate: 0.90
 
Minimax Type: Minimize
 
Elitism: True
 
Elitism Replacement: 1
 DB
Adapter: DBSQLite DB Adapter [File='pyevolve.db', identify='ackley']
 
Slot [Selector] (Count: 2)
 
Name: GRankSelector - Weight: 0.50
 
Doc:  The Rank Selector - This selector will pick the best individual of
   the population every time
.
   
 
Name: GRouletteWheel - Weight: 0.30
 
Doc:  The Roulette Wheel selector
 
Slot [Generation Step Callback] (Count: 0)
 
No function
 
Slot [Termination Criteria] (Count: 1)
 
Name: RawScoreCriteria - Weight: 0.50
 
Doc:  Terminate the evolution using the **bestrawscore** and **rounddecimal**
   parameter obtained
from the individual


   
Example:
     
>>> genome.setParams(bestrawscore=0.00, rounddecimal=2)
     
(...)
     
>>> ga_engine.terminationCriteria.set(GSimpleGA.RawScoreCriteria)

 As you can see, the first Selector has a weight of 0.5 and the second one has 0.3! So, if we look at:
>>> ga.selector.funcWeights
[0.5, 0.3, 0.7]

We can see the "funcWeights" has three elements and this may causes the problem. if we modify this list according to our desire weights, it will work fine. Please let me know if im right. 

Christian S. Perone

unread,
Jul 2, 2017, 12:03:21 PM7/2/17
to pyev...@googlegroups.com
Hi Saeed, this was a known regression of the 0.6rc1, please install the master version: 

Best,

--

---
You received this message because you are subscribed to the Google Groups "pyevolve" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyevolve+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
"Forgive, O Lord, my little jokes on Thee, and I'll forgive Thy great big joke on me."

Saeed Soltani Moghadam

unread,
Jul 2, 2017, 1:24:47 PM7/2/17
to pyevolve
Thanks, It seems i used a buggy version, because there were other issues which are now fixed! Great!
To unsubscribe from this group and stop receiving emails from it, send an email to pyevolve+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages