Salome HOME
Updated copyright comment
[modules/yacs.git] / src / yacsloader_swig / Test / optim_plugin.py
index d43d070b34d77a30460fb7da46d12ba93ce23298..79e76d3725bd23abe4ced2e50cd8cb37ace84b09 100644 (file)
@@ -1,3 +1,22 @@
+# Copyright (C) 2015-2024  CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
 import SALOMERuntime
 
 class myalgosync(SALOMERuntime.OptimizerAlgSync):
@@ -33,11 +52,11 @@ class myalgosync(SALOMERuntime.OptimizerAlgSync):
     """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 start(self):
     """Start to fill the pool with samples to evaluate."""
-    print "Algo start "
+    print("Algo start ")
     self.iter=0
     # pushInSample(id, value)
     self.pool.pushInSample(self.iter, 1)
@@ -50,7 +69,7 @@ class myalgosync(SALOMERuntime.OptimizerAlgSync):
     currentId=self.pool.getCurrentId()
     valIn = self.pool.getCurrentInSample().getIntValue()
     valOut = self.pool.getCurrentOutSample().getIntValue()
-    print "Algo takeDecision currentId=%s, valIn=%s, valOut=%s" % (currentId, valIn, valOut)
+    print("Algo takeDecision currentId=%s, valIn=%s, valOut=%s" % (currentId, valIn, valOut))
 
     self.iter=self.iter+1
     if self.iter < 3:
@@ -61,7 +80,7 @@ class myalgosync(SALOMERuntime.OptimizerAlgSync):
   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):