Salome HOME
bos #26594 Failed KERNEL test: fix typemap for swig 4x
[modules/yacs.git] / src / yacsloader / Test / algoasyncexample.py
index ce286e163e18e3b393fc32508b2a545388fd7cb5..d944f12de3c7635b52984a4175304082bc012b62 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2006-2021  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -52,7 +52,7 @@ class myalgoasync(SALOMERuntime.OptimizerAlgASync):
     """Optional method called on initialization.
        The type of "input" is returned by "getTCForAlgoInit"
     """
     """Optional method called on initialization.
        The type of "input" is returned by "getTCForAlgoInit"
     """
-    print "Algo initialize, input = ", input.getIntValue()
+    print("Algo initialize, input = ", input.getIntValue())
 
   def startToTakeDecision(self):
     """This method is called only once to launch the algorithm. It must
 
   def startToTakeDecision(self):
     """This method is called only once to launch the algorithm. It must
@@ -66,7 +66,7 @@ class myalgoasync(SALOMERuntime.OptimizerAlgASync):
        pool, do nothing (wait for more samples), or empty the pool and
        return to finish the evaluation.
     """
        pool, do nothing (wait for more samples), or empty the pool and
        return to finish the evaluation.
     """
-    print "startToTakeDecision"
+    print("startToTakeDecision")
     # fill the pool with samples
     iter=0
     self.pool.pushInSample(0, 0.5)
     # fill the pool with samples
     iter=0
     self.pool.pushInSample(0, 0.5)
@@ -77,7 +77,7 @@ class myalgoasync(SALOMERuntime.OptimizerAlgASync):
       currentId=self.pool.getCurrentId()
       valIn = self.pool.getCurrentInSample().getDoubleValue()
       valOut = self.pool.getCurrentOutSample().getIntValue()
       currentId=self.pool.getCurrentId()
       valIn = self.pool.getCurrentInSample().getDoubleValue()
       valOut = self.pool.getCurrentOutSample().getIntValue()
-      print "Compute currentId=%s, valIn=%s, valOut=%s" % (currentId, valIn, valOut)
+      print("Compute currentId=%s, valIn=%s, valOut=%s" % (currentId, valIn, valOut))
       iter=iter+1
       
       if iter < 3:
       iter=iter+1
       
       if iter < 3:
@@ -89,7 +89,7 @@ class myalgoasync(SALOMERuntime.OptimizerAlgASync):
   def finish(self):
     """Optional method called when the algorithm has finished, successfully
        or not, to perform any necessary clean up."""
   def finish(self):
     """Optional method called when the algorithm has finished, successfully
        or not, to perform any necessary clean up."""
-    print "Algo finish"
+    print("Algo finish")
     self.pool.destroyAll()
 
   def getAlgoResult(self):
     self.pool.destroyAll()
 
   def getAlgoResult(self):