state_sequence = pilot.SequenceAny_New(variable_sequence.getType())
time_sequence = pilot.SequenceAny_New(state_sequence.getType())
- print "Input Data", data
+ #print "Input Data", data
if isinstance(data, type((1,2))):
self.add_parameters(data[0], variable_sequence)
self.add_parameters(data[1], variable_sequence, Output=True) # Output == Y
data = []
outputValues = any_data["outputValues"]
- print outputValues
+ #print outputValues
for variable in outputValues[0][0]:
for i in range(variable.size()):
data.append(variable[i].getDoubleValue())
return matrix
def Direct(self, X, sync = 1):
- print "Call Direct OptimizerHooks"
+ #print "Call Direct OptimizerHooks"
if sync == 1:
# 1: Get a unique sample number
self.counter_lock.acquire()
# 3: Wait
while 1:
- print "waiting"
+ #print "waiting"
self.optim_algo.signalMasterAndWait()
- print "signal"
+ #print "signal"
if self.optim_algo.isTerminationRequested():
self.optim_algo.pool.destroyAll()
return
self.counter_lock.release()
return Y
else:
- print "sync false is not yet implemented"
+ #print "sync false is not yet implemented"
self.optim_algo.setError("sync == false not yet implemented")
def Tangent(self, X, sync = 1):
- print "Call Tangent OptimizerHooks"
+ #print "Call Tangent OptimizerHooks"
if sync == 1:
# 1: Get a unique sample number
self.counter_lock.acquire()
self.counter_lock.release()
return Y
else:
- print "sync false is not yet implemented"
+ #print "sync false is not yet implemented"
self.optim_algo.setError("sync == false not yet implemented")
def Adjoint(self, (X, Y), sync = 1):
- print "Call Adjoint OptimizerHooks"
+ #print "Call Adjoint OptimizerHooks"
if sync == 1:
# 1: Get a unique sample number
self.counter_lock.acquire()
# 3: Wait
while 1:
- print "waiting"
+ #print "waiting"
self.optim_algo.signalMasterAndWait()
- print "signal"
+ #print "signal"
if self.optim_algo.isTerminationRequested():
self.optim_algo.pool.destroyAll()
return
self.counter_lock.release()
return Z
else:
- print "sync false is not yet implemented"
+ #print "sync false is not yet implemented"
self.optim_algo.setError("sync == false not yet implemented")
class AssimilationAlgorithm_asynch(SALOMERuntime.OptimizerAlgASync):
# input vient du port algoinit, input est un Any YACS !
def initialize(self,input):
- print "Algorithme initialize"
+ #print "Algorithme initialize"
# get the daStudy
#print "[Debug] Input is ", input
self.ADD = self.da_study.getAssimilationStudy()
def startToTakeDecision(self):
- print "Algorithme startToTakeDecision"
+ #print "Algorithme startToTakeDecision"
# Check if ObservationOperator is already set
if self.da_study.getObservationOperatorType("Direct") == "Function" or self.da_study.getObservationOperatorType("Tangent") == "Function" or self.da_study.getObservationOperatorType("Adjoint") == "Function" :
- print "Set Hooks"
+ #print "Set Hooks"
# Use proxy function for YACS
self.hooks = OptimizerHooks(self)
direct = tangent = adjoint = None
# Start Assimilation Study
- print "ADD analyze"
+ #print "ADD analyze"
self.ADD.analyze()
# Assimilation Study is finished
self.pool.destroyAll()
def getAlgoResult(self):
- print "getAlgoResult"
+ #print "getAlgoResult"
self.ADD.prepare_to_pickle()
result = pickle.dumps(self.da_study)
return result
# Obligatoire ???
def finish(self):
- print "Algorithme finish"
+ #print "Algorithme finish"
def parseFileToInit(self,fileName):
- print "Algorithme parseFileToInit"
+ #print "Algorithme parseFileToInit"
# Fonctions qui ne changent pas
def setPool(self,pool):