Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
91540be5
Commit
91540be5
authored
Nov 03, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commented code removed to work faster. Prototype not for asynchronous
parent
80c1bd69
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
41 deletions
+2
-41
dream/plugins/Batches/BatchesStochasticACO.py
dream/plugins/Batches/BatchesStochasticACO.py
+2
-41
No files found.
dream/plugins/Batches/BatchesStochasticACO.py
View file @
91540be5
...
...
@@ -116,49 +116,10 @@ class BatchesStochasticACO(BatchesACO):
ant
[
'input'
]
=
ant_data
scenario_list
.
append
(
ant
)
# if distributor is None:
# if multiprocessorCount:
# self.logger.info("running multiprocessing ACO with %s processes" % multiprocessorCount)
# # We unset our signal handler to print traceback at the end
# # otherwise logs are confusing.
# sigterm_handler = signal.getsignal(signal.SIGTERM)
# pool = Pool(processes=multiprocessorCount)
# try:
# signal.signal(signal.SIGTERM, signal.SIG_DFL)
# scenario_list = pool.map(runAntInSubProcess, scenario_list)
# pool.close()
# pool.join()
# finally:
# signal.signal(signal.SIGTERM, sigterm_handler)
# else:
# # synchronous
# run the deterministic ants
for
ant
in
scenario_list
:
ant
[
'result'
]
=
self
.
runOneScenario
(
ant
[
'input'
])[
'result'
]
# else: # asynchronous
# self.logger.info("Registering a job for %s scenarios" % len(scenario_list))
# start_register = time.time()
# job_id = distributor.requestSimulationRun(
# [json.dumps(x).encode('zlib').encode('base64') for x in scenario_list])
# self.logger.info("Job registered as %s (took %0.2fs)" % (job_id, time.time() - start_register ))
#
# while True:
# time.sleep(1.)
# result_list = distributor.getJobResult(job_id)
# # The distributor returns None when calculation is still ongoing,
# # or the list of result in the same order.
# if result_list is not None:
# self.logger.info("Job %s terminated" % job_id)
# break
#
# for ant, result in zip(scenario_list, result_list):
# result = json.loads(result)
# if 'result' in result: # XXX is this still needed ???
# result = result['result']
# assert "result_list" in result
# else:
# result = {'result_list': [result]}
# ant['result'] = result
for
ant
in
scenario_list
:
ant
[
'score'
]
=
self
.
_calculateAntScore
(
ant
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment