Commit 3ffbc9e5 authored by Jérome Perrin's avatar Jérome Perrin

log to dream.log from manpy

parent c0406a63
...@@ -59,6 +59,10 @@ from random import Random ...@@ -59,6 +59,10 @@ from random import Random
import sys import sys
import os.path import os.path
import logging
logger = logging.getLogger("dream.platform")
#reads general simulation inputs #reads general simulation inputs
def readGeneralInput(): def readGeneralInput():
general=G.JSONData['general'] general=G.JSONData['general']
...@@ -72,7 +76,7 @@ def createObjects(): ...@@ -72,7 +76,7 @@ def createObjects():
#Read the json data #Read the json data
elementList = G.JSONData['elementList'] elementList = G.JSONData['elementList']
#modelResourceList = G.JSONData['modelResource'] #modelResourceList = G.JSONData['modelResource']
#define the lists #define the lists
G.SourceList=[] G.SourceList=[]
G.MachineList=[] G.MachineList=[]
...@@ -101,6 +105,7 @@ def createObjects(): ...@@ -101,6 +105,7 @@ def createObjects():
#loop through all the elements #loop through all the elements
#read the data and create them #read the data and create them
for element in elementList: for element in elementList:
objClass=element.get('_class', 'not found') objClass=element.get('_class', 'not found')
if objClass=='Dream.Source': if objClass=='Dream.Source':
id=element.get('id', 'not found') id=element.get('id', 'not found')
...@@ -305,7 +310,7 @@ def main(argv=[], input_data=None): ...@@ -305,7 +310,7 @@ def main(argv=[], input_data=None):
#run the experiment (replications) #run the experiment (replications)
for i in xrange(G.numberOfReplications): for i in xrange(G.numberOfReplications):
print "start run number "+str(i+1) logger.info("start run number "+str(i+1))
G.seed+=1 G.seed+=1
G.Rnd=Random(G.seed) G.Rnd=Random(G.seed)
...@@ -359,7 +364,7 @@ def main(argv=[], input_data=None): ...@@ -359,7 +364,7 @@ def main(argv=[], input_data=None):
G.outputFile.save("output.xls") G.outputFile.save("output.xls")
''' '''
print "execution time="+str(time.time()-start) logger.info("execution time="+str(time.time()-start))
if input_data: if input_data:
return outputJSONString return outputJSONString
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment