Skip to content

Commit

Permalink
Beautify FlatConTypes() #232
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Mar 25, 2024
1 parent 8dc475f commit db3c4a0
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 68 deletions.
134 changes: 67 additions & 67 deletions support/modelexplore/scripts/python/con_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,71 @@

def FlatConTypes():
res = {
'_abs': 'AbsConstraint',
'_acos': 'AcosConstraint',
'_acosh': 'AcoshConstraint',
'_alldiff': 'AllDiffConstraint',
'_and': 'AndConstraint',
'_asin': 'AsinConstraint',
'_asinh': 'AsinhConstraint',
'_atan': 'AtanConstraint',
'_atanh': 'AtanhConstraint',
'_compl': 'ComplementarityLinear',
'_complquad': 'ComplementarityQuadratic',
'_condlineq': 'CondLinConEQ',
'_condlinge': 'CondLinConGE',
'_condlingt': 'CondLinConGT',
'_condlinle': 'CondLinConLE',
'_condlinlt': 'CondLinConLT',
'_condquadeq': 'CondQuadConEQ',
'_condquadge': 'CondQuadConGE',
'_condquadgt': 'CondQuadConGT',
'_condquadle': 'CondQuadConLE',
'_condquadlt': 'CondQuadConLT',
'_cos': 'CosConstraint',
'_cosh': 'CoshConstraint',
'_count': 'CountConstraint',
'_div': 'DivConstraint',
'_expa': 'ExpAConstraint',
'_exp': 'ExpConstraint',
'_expcone': 'ExponentialConeConstraint',
'_geomcone': 'GeometricConeConstraint',
'_ifthen': 'IfThenConstraint',
'_impl': 'ImplicationConstraint',
'_indeq': 'IndicatorConstraintLinEQ',
'_indge': 'IndicatorConstraintLinGE',
'_indle': 'IndicatorConstraintLinLE',
'_indquadeq': 'IndicatorConstraintQuadEQ',
'_indquadge': 'IndicatorConstraintQuadGE',
'_indquadle': 'IndicatorConstraintQuadLE',
'_lineq': 'LinConEQ',
'_linge': 'LinConGE',
'_linle': 'LinConLE',
'_linrange': 'LinConRange',
'_linfunccon': 'LinearFunctionalConstraint',
'_loga': 'LogAConstraint',
'_log': 'LogConstraint',
'_max': 'MaxConstraint',
'_min': 'MinConstraint',
'_not': 'NotConstraint',
'_numberofconst': 'NumberofConstConstraint',
'_numberofvar': 'NumberofVarConstraint',
'_or': 'OrConstraint',
'_pl': 'PLConstraint',
'_pow': 'PowConstraint',
'_powercone': 'PowerConeConstraint',
'_quadeq': 'QuadConEQ',
'_quadge': 'QuadConGE',
'_quadle': 'QuadConLE',
'_quadrange': 'QuadConRange',
'_quadcone': 'QuadraticConeConstraint',
'_quadfunccon': 'QuadraticFunctionalConstraint',
'_rotatedquadcone': 'RotatedQuadraticConeConstraint',
'_sos1': 'SOS1Constraint',
'_sos2': 'SOS2Constraint',
'_sin': 'SinConstraint',
'_sinh': 'SinhConstraint',
'_tan': 'TanConstraint',
'_tanh': 'TanhConstraint',
'_uenc': 'UnaryEncodingConstraint' }
'_abs': 'Abs',
'_acos': 'Acos',
'_acosh': 'Acosh',
'_alldiff': 'AllDiff',
'_and': 'And',
'_asin': 'Asin',
'_asinh': 'Asinh',
'_atan': 'Atan',
'_atanh': 'Atanh',
'_compl': 'Complementarity Linear',
'_complquad': 'Complementarity Quadratic',
'_condlineq': 'Conditional Linear \u2A75',
'_condlinge': 'Conditional Linear \u2A7E',
'_condlingt': 'Conditional Linear >',
'_condlinle': 'Conditional Linear \u2A7D',
'_condlinlt': 'Conditional Linear <',
'_condquadeq': 'Conditional Quadratic \u2A75',
'_condquadge': 'Conditional Quadratic \u2A7E',
'_condquadgt': 'Conditional Quadratic >',
'_condquadle': 'Conditional Quadratic \u2A7D',
'_condquadlt': 'Conditional Quadratic <',
'_cos': 'Cos',
'_cosh': 'Cosh',
'_count': 'Count',
'_div': 'Div',
'_expa': 'ExpA',
'_exp': 'Exp',
'_expcone': 'Exponential Cone',
'_geomcone': 'Geometric Cone',
'_ifthen': 'If-Then',
'_impl': 'Implication \u21D2',
'_indeq': 'Indicator Linear \u2A75',
'_indge': 'Indicator Linear \u2A7E',
'_indle': 'Indicator Linear \u2A7D',
'_indquadeq': 'Indicator Quadratic \u2A75',
'_indquadge': 'Indicator Quadratic \u2A7E',
'_indquadle': 'Indicator Quadratic \u2A7D',
'_lineq': 'Linear \u2A75',
'_linge': 'Linear \u2A7E',
'_linle': 'Linear \u2A7D',
'_linrange': 'Linear Range',
'_linfunccon': 'Linear Function',
'_loga': 'LogA',
'_log': 'Log',
'_max': 'Max',
'_min': 'Min',
'_not': 'Not',
'_numberofconst': 'Numberof/Const',
'_numberofvar': 'Numberof/Var',
'_or': 'Or',
'_pl': 'Piecewise-Linear',
'_pow': 'Pow',
'_powercone': 'Power Cone',
'_quadeq': 'Quadratic \u2A75',
'_quadge': 'Quadratic \u2A7E',
'_quadle': 'Quadratic \u2A7D',
'_quadrange': 'Quadratic Range',
'_quadcone': 'Quadratic Cone',
'_quadfunccon': 'Quadratic Function',
'_rotatedquadcone': 'Rotated Quadratic Cone',
'_sos1': 'SOS1',
'_sos2': 'SOS2',
'_sin': 'Sin',
'_sinh': 'Sinh',
'_tan': 'Tan',
'_tanh': 'Tanh',
'_uenc': 'Unary Encoding' }
return res
3 changes: 2 additions & 1 deletion support/modelexplore/scripts/python/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def MatchFinalModel(self, keyw):
result["Objectives"] = self._matchRecords(self._objs, keyw)
ctypes = FlatConTypes()
for ct, cv in sorted(self._cons_Flat.items()):
result["Constraints '" + ctypes[ct] + "'"] \
result["Constraints '" + \
(ctypes[ct] if ct in ctypes else ct) + "'"] \
= self._matchRecords(self._cons_Flat[ct], keyw)
return result

Expand Down

0 comments on commit db3c4a0

Please sign in to comment.