diff --git a/app/constants.py b/app/constants.py index de49de1..8f606c6 100644 --- a/app/constants.py +++ b/app/constants.py @@ -1,5 +1,19 @@ -version = "v1.0.0" +from pydantic import BaseModel -# solver parameter -n_max_precise = 9 # 10 takes 30s on a beefy desktop, 9 only 1.2s -n_max = 500 # around 1 million with n^2 +# used for git tags +version = "v1.0.1" + + +class SolverSettings(BaseModel): + bruteforce_max_combinations: int + n_max: int + + +# TODO should be startup parameter +solverSettings = SolverSettings( + # Desktop with Ryzen 2700X: + # (4, 3, 2)=1260 => 0.1s, (4, 3, 3)=4200 => 0.8s, (5, 3, 3)=9240 => 8s + bruteforce_max_combinations=5000, + # that is already unusable x100, but the solver takes it easily + n_max=2000 +) diff --git a/app/main.py b/app/main.py index bc75f42..a4e337f 100644 --- a/app/main.py +++ b/app/main.py @@ -6,8 +6,7 @@ from starlette.requests import Request from starlette.responses import HTMLResponse, PlainTextResponse -from app.constants import version, n_max_precise, n_max - +from app.constants import version, solverSettings # don't mark /app as a sources root or pycharm will delete the "app." prefix # that's needed for pytest to work correctly from app.solver.data.Job import Job @@ -84,15 +83,9 @@ def get_debug(): @app.get("/constants", response_class=HTMLResponse) -def get_debug(): - static_answer = ( - "Constants:" - "