def METHOD_NAME(cls):
    opName = cls.ex_getProperty("fullName")
    opName = "/".join(opName.split("/")[1:])
    if opName.find("Agent") == len(opName) - 5:
        opName = opName[:-5]
    cls.__optimizerName = opName
    maxTasks = cls.ex_getOption("Tasks", 1)
    cls.__jobData = threading.local()
    cls.__jobData.jobState = None
    cls.__jobData.jobLog = None
    cls.ex_setProperty("optimizerName", cls.__optimizerName)
    try:
        result = cls.initializeOptimizer()
        if not result["OK"]:
            return result
    except Exception as excp:
        cls.log.exception("Error while initializing optimizer")
        return S_ERROR(f"Error initializing: {str(excp)}")
    cls.ex_setMind("WorkloadManagement/OptimizationMind")
    return S_OK()