solver: Add abstract solver class.

mesh
Pierre-Antoine Rouby 2023-03-09 10:37:14 +01:00
parent 1d0f0723d1
commit c4373fa00a
1 changed files with 40 additions and 0 deletions

40
src/solver/ASolver.py Normal file
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 ""