# Path: ipet/Key.py
# CONTEXT_LOGFILE = 1  # the log file of a solver which most readers are reading from
# CONTEXT_ERRFILE = 2  # the error file of a solver
# CONTEXT_SETFILE = 3  # the settings file used for solving
# CONTEXT_TRACEFILE = 5
# CONTEXT_METAFILE = 0  # the metadata
#     MINIMIZE = 1
#     MAXIMIZE = -1
# class SolverStatusCodes:
# class ProblemStatusCodes:
# class ObjectiveSenseCode:
#     def getBestStatus(*args):
#     def getWorstStatus(*args):
# def solverToProblemStatusCode(solverstatus : int) -> str:
# 
# Path: ipet/misc/misc.py
# FLOAT_INFINITY = 1e20
# FLOAT_LARGE = 1e15
# DEFAULT_MIN_GEOM_MEAN = 1.0
#     FLOAT_INFINITY = infinity
# def sortingKeyContext(context):
# def filenameGetContext(filename):
# def getWordAtIndex(line : str, index : int) -> str:
# def getNumberAtIndex(line : str, index : int) -> str:
# def getSoluFileProbName(probname):
# def floatPrint(number, digitsbef=16, digitsafter=9, dispchar='g'):
# def getTexName(name):
# def getCplexGap(value, referencevalue):
# def getGap(value : float, referencevalue : float, useCplexGap : bool=False) -> float:
# def listGetArithmeticMean(listofnumbers):
# def iqr(listofnumbers):
# def lQuart(listofnumbers):
# def uQuart(listofnumbers):
# def shmean(listofnumbers, shiftby=10.0):
# def gemean(listofnumbers, mingeommean=DEFAULT_MIN_GEOM_MEAN):
# def listGetGeomMean(listofnumbers, mingeommean=DEFAULT_MIN_GEOM_MEAN):
# def listGetShiftedGeometricMean(listofnumbers, shiftby=10.0):
# def getVariabilityScore(listofnumbers):
# def isInfinite(value : float) -> bool:
# def getInfinity() -> float:
# def setInfinity(infinity : float):
# def cutString(string, char='_', maxlength=-1):
# def listGetMinColWidth(listofitems):
# def strConcat(strings : list) -> str:
# def meanOrConcat(l : list):
# def saveAsXML(nodeobject, filename : str) -> None:
# def convertTimeStamp(timestamp : float) -> str:


import re
import os
import logging
from ipet import Key
from ipet.misc import misc
from operator import itemgetter
from builtins import int, str
from numpy import char

class Solver():
    """ The solver-class acts as Reader for solver-specific data.

    After being fed the out-file line by line to readLine(line)
    the solver can return the collected data via getData().
    When reading multiple runs, the solver has to be reset via reset().

    This class has to be inherited by a SpecificSolver-class and
    should not be used as it is.
    """

    DEFAULT = None
    solverId = "defaultSolver"
    recognition_expr = None
    primalbound_expr = None
    dualbound_expr = None
    solvingtime_expr = None
    version_expr = None
    nodes_expr = None
    violbound_expr = None
    violint_expr = None
    viollp_expr = None
    violcons_expr = None

    solverstatusmap = {}

    objsensemap = {}

    codes_nobound = set(

# Path: ipet/Key.py
# CONTEXT_LOGFILE = 1  # the log file of a solver which most readers are reading from
# CONTEXT_ERRFILE = 2  # the error file of a solver
# CONTEXT_SETFILE = 3  # the settings file used for solving
# CONTEXT_TRACEFILE = 5
# CONTEXT_METAFILE = 0  # the metadata
#     MINIMIZE = 1
#     MAXIMIZE = -1
# class SolverStatusCodes:
# class ProblemStatusCodes:
# class ObjectiveSenseCode:
#     def getBestStatus(*args):
#     def getWorstStatus(*args):
# def solverToProblemStatusCode(solverstatus : int) -> str:
# 
# Path: ipet/misc/misc.py
# FLOAT_INFINITY = 1e20
# FLOAT_LARGE = 1e15
# DEFAULT_MIN_GEOM_MEAN = 1.0
#     FLOAT_INFINITY = infinity
# def sortingKeyContext(context):
# def filenameGetContext(filename):
# def getWordAtIndex(line : str, index : int) -> str:
# def getNumberAtIndex(line : str, index : int) -> str:
# def getSoluFileProbName(probname):
# def floatPrint(number, digitsbef=16, digitsafter=9, dispchar='g'):
# def getTexName(name):
# def getCplexGap(value, referencevalue):
# def getGap(value : float, referencevalue : float, useCplexGap : bool=False) -> float:
# def listGetArithmeticMean(listofnumbers):
# def iqr(listofnumbers):
# def lQuart(listofnumbers):
# def uQuart(listofnumbers):
# def shmean(listofnumbers, shiftby=10.0):
# def gemean(listofnumbers, mingeommean=DEFAULT_MIN_GEOM_MEAN):
# def listGetGeomMean(listofnumbers, mingeommean=DEFAULT_MIN_GEOM_MEAN):
# def listGetShiftedGeometricMean(listofnumbers, shiftby=10.0):
# def getVariabilityScore(listofnumbers):
# def isInfinite(value : float) -> bool:
# def getInfinity() -> float:
# def setInfinity(infinity : float):
# def cutString(string, char='_', maxlength=-1):
# def listGetMinColWidth(listofitems):
# def strConcat(strings : list) -> str:
# def meanOrConcat(l : list):
# def saveAsXML(nodeobject, filename : str) -> None:
# def convertTimeStamp(timestamp : float) -> str:


# Path: ipet/parsing/Solver.py
import re
import os
import logging
from ipet import Key
from ipet.misc import misc
from operator import itemgetter
from builtins import int, str
from numpy import char


class Solver():
    """ The solver-class acts as Reader for solver-specific data.

    After being fed the out-file line by line to readLine(line)
    the solver can return the collected data via getData().
    When reading multiple runs, the solver has to be reset via reset().

    This class has to be inherited by a SpecificSolver-class and
    should not be used as it is.
    """

    DEFAULT = None
    solverId = "defaultSolver"
    recognition_expr = None
    primalbound_expr = None
    dualbound_expr = None
    solvingtime_expr = None
    version_expr = None
    nodes_expr = None
    violbound_expr = None
    violint_expr = None
    viollp_expr = None
    violcons_expr = None

    solverstatusmap = {}

    objsensemap = {}

    codes_nobound = set(

        [Key.SolverStatusCodes.Crashed,