fix: Toleranz bei Relaxationsschranke, Grund bei fehlgeschlagenem Szenario
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
c68a293755
commit
ee9a193cd7
2 changed files with 27 additions and 3 deletions
|
|
@ -143,3 +143,9 @@ def test_report_shows_sensitivity_and_integrality_price():
|
|||
page = to_html(build_document(result))
|
||||
assert "Sensitivität der bindenden Restriktionen" in page and "Preis der Ganzzahligkeit" in page
|
||||
assert "0,1" in page.replace(".", ",") or "0.1" in page # (12100-12000)/1000 = 0.1
|
||||
|
||||
|
||||
def test_relaxation_bound_equal_up_to_rounding_is_no_warning():
|
||||
# beobachtet (Portfolio Nr. 2): 0.13896862211718014 gegen 0.13896862211718017
|
||||
run = sens_run([], objective=0.13896862211718017, relaxation=0.13896862211718014)
|
||||
assert check_sensitivity(run, "maximize") == []
|
||||
|
|
|
|||
|
|
@ -753,3 +753,15 @@ def test_ordinary_programs_are_not_suspected():
|
|||
from solving.solver_stage import check_generated_data
|
||||
code = "import highspy\nh = highspy.Highs()\nDATA = {'kosten': [3, 2]}\n"
|
||||
assert check_generated_data(code, SolverCode(code=code, data_assumptions=[])) == []
|
||||
|
||||
|
||||
def test_scenario_failing_without_error_text_gets_a_reason():
|
||||
# beobachtet (Portfolio Nr. 2): Szenario ohne Lösung im Zeitlimit, Warnung endete mit leerem Grund
|
||||
from core.model_schema import Scenario
|
||||
from solving.solver_stage import verify_scenarios
|
||||
code = SZENARIO_CODE.replace(' basis = loesen(DATA)\n',
|
||||
' basis = loesen(DATA)\n if DATA["preis"] > 15:\n'
|
||||
' report("error", None, {})\n return\n')
|
||||
run = run_solver_code(code)
|
||||
befunde = verify_scenarios(run, code)
|
||||
assert any("doppelter Preis" in b and "ohne Fehlertext" in b for b in befunde)
|
||||
|
|
|
|||
Loading…
Reference in a new issue