-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
formatted the Python modules to be at least partially pep8-compliant;…
… I also improved the README file with more info; I added the full GNU v3 license for reference.
- Loading branch information
Showing
64 changed files
with
1,642 additions
and
914 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,30 +1,33 @@ | ||
from agent.agent import Agent | ||
from algorithm.parameters import params | ||
#from fitness.evaluation import evaluate_fitness | ||
from stats.stats import stats | ||
#from utilities.stats import trackers | ||
#from operators.initialisation import initialisation | ||
#from utilities.algorithm.initialise_run import pool_init | ||
|
||
def create_agents(n,p): | ||
|
||
# from fitness.evaluation import evaluate_fitness | ||
# from utilities.stats import trackers | ||
# from operators.initialisation import initialisation | ||
# from utilities.algorithm.initialise_run import pool_init | ||
|
||
def create_agents(n, p): | ||
""" | ||
Create a list of agent specified by n parameter | ||
""" | ||
return [ Agent(p) for a in range(n) ] | ||
return [Agent(p) for a in range(n)] | ||
|
||
|
||
def search_loop(): | ||
""" | ||
This loop is used when the multi-agent parameter is passed | ||
""" | ||
# Create a list of agents based on the parameter passed | ||
agents = create_agents(params['AGENT_SIZE'],params['INTERACTION_PROBABILITY']) | ||
agents = create_agents(params['AGENT_SIZE'], | ||
params['INTERACTION_PROBABILITY']) | ||
|
||
##Multi-Agent based GE | ||
for generation in range(1,(params['GENERATIONS']+1)): | ||
## Multi-Agent based GE | ||
for generation in range(1, (params['GENERATIONS'] + 1)): | ||
stats['gen'] = generation | ||
#New generation | ||
|
||
# New generation | ||
agents = params['STEP'](agents) | ||
return [agent.individual[0] for agent in agents] | ||
|
||
return [agent.individual[0] for agent in agents] |
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
Oops, something went wrong.