Ejemplo n.º 1
0
def testManySteps(w, stfn, N):
	if not astore.verify(stfn, 23):
		astore.empty(stfn, 23)
	a=astore.ArrayStore(stfn, 'w')
	for i in range(N):
		if not i%100:
			print i
		z=randomStep()
		r=testStep(w, z)
		r=concatenate([z, array(r)])
		a.append(r)
		if not r[0]<0:
			print i, r
	a.close()	
Ejemplo n.º 2
0
Archivo: base.py Proyecto: gic888/MIEN
	def prep(self):
		'''Set up the optimization run. This includes setting up any initial conditions opening files, making directories, setting hidden attributes, etc. Subclasses must overload this method. It is required to call prep or resume before calling methods that run or test the algorithm or access data.'''
		self.initialize_vars()
		if self.attrib("BaseFileName"):
			self.setAttrib('File', self.attrib("BaseFileName"))
		fn=ast.empty(self.attrib("File"), self._storesize, self.attrib("ThreadSafe"))
		if fn != self.attrib("File"):
			self.setAttrib("BaseFileName", self.attrib("File"))
			self.setAttrib('File', fn)
		self._store=ast.ArrayStore(fn, 'w')
		self.report("prep complete")
Ejemplo n.º 3
0
def writeSteps(fn, a):
	z=ast.empty(fn, a.shape[1])
	z=ast.ArrayStore(fn, 'w')
	z.setarray(a)
	z.close()