예제 #1
0
def genBatch(SysParm):

    SysString, N, nPool = SysParm
    offset = nPool * N

    DataAll = []

    start = time.time()
    for samp in range(N):
        RES = lcs.simulate(SysString, samp + offset)
        data = RES[0]
        labels = RES[1]
        DataAll.append(np.array(RES[0], dtype=np.double))
        timeLeft = (N - samp + 1) * ((time.time() - start) / (samp + 1))
        #print samp+offset, ', seconds left =', timeLeft, ', minutes left =', timeLeft/60.0

    return labels, np.array(DataAll)
예제 #2
0
    def iterate(self):
        try:
            #seed = int(time.time()) + self.identifier
            if self.timeout:
                self.data = self.finalize_data(*chemfast_timeout.simulate(
                    self.system_string, self.timeout))
                #self.system_string, seed, self.timeout))

            else:
                self.data = self.finalize_data(
                    *chemfast.simulate(self.system_string))
                #*chemfast.simulate(self.system_string, seed))

        except:
            traceback.print_exc(file=sys.stdout)
            print 'simulation failed; aborting'
            self.bAbort = True
예제 #3
0
파일: acidTest1.py 프로젝트: ctogle/modular
def genBatch(SysParm):

	SysString, N, nPool = SysParm
	offset = nPool*N

	DataAll = []
	
	start = time.time()
	for samp in range(N):
		RES = lcs.simulate(SysString, samp+offset)
		data = RES[0]
		labels = RES[1]
		DataAll.append(np.array(RES[0], dtype=np.double))
		timeLeft = (N-samp+1)*((time.time()-start)/(samp+1))
		#print samp+offset, ', seconds left =', timeLeft, ', minutes left =', timeLeft/60.0

	return labels, np.array(DataAll)
예제 #4
0
	def iterate(self):
		try:
			#seed = int(time.time()) + self.identifier
			if self.timeout:
				self.data = self.finalize_data(
					*chemfast_timeout.simulate(
						self.system_string, self.timeout))
						#self.system_string, seed, self.timeout))

			else:
				self.data = self.finalize_data(
					*chemfast.simulate(self.system_string))
					#*chemfast.simulate(self.system_string, seed))

		except:
			traceback.print_exc(file=sys.stdout)
			print 'simulation failed; aborting'
			self.bAbort = True