solver: Add abstract solver class.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-03-09 14:24:17 +01:00
1 parent 1d0f0723d1
commit c4373fa00a
1 file changed
+40
+40
View File
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
import os
import subprocess
from enum import Enum
class STATUS(Enum):
STOPED = 0
RUNNING = 1
FAILED = 2
CONF_ERROR = 3
class AbstractSolver(object):
def __init__(self, name):
super(AbstractSolver, self).__init__()
self.name = name
self.status = STATUS.STOPED
def nb_proc(self):
"""
Return the number of processor used by solver (usefull for
multiple solver run on same time).
"""
return 1
def status(self):
return self.status
def set_status(self, status):
self.status = status
def run(self):
return False
def kill(self):
return False
def readline(self):
return ""