refactor of model targets and constraints, addition of new constraint types and constraint construction process

This commit is contained in:
Joshua Burman
2023-11-12 18:32:48 -05:00
parent 07af0ac0ac
commit f1fa519f31
16 changed files with 140 additions and 86 deletions

View File

@ -1,14 +1,15 @@
from lib.irt.test_response_function import TestResponseFunction
from lib.irt.test_information_function import TestInformationFunction
from models.target import Target
from models.targets.tif_target import TifTarget
from models.targets.tcc_target import TccTarget
def generate_tif_results(items, solver_run):
targets = []
for target in solver_run.objective_function.tif_targets:
tif = TestInformationFunction(solver_run.irt_model).calculate(items, theta=target.theta)
targets.append(Target(theta=target.theta, value=target.value, result=tif))
targets.append(TifTarget(theta=target.theta, value=target.value, result=tif))
return targets
@ -17,6 +18,6 @@ def generate_tcc_results(items, solver_run):
for target in solver_run.objective_function.tcc_targets:
tcc = TestResponseFunction(solver_run.irt_model).calculate(items, theta=target.theta)
targets.append(Target(theta=target.theta, value=target.value, result=tcc))
targets.append(TccTarget(theta=target.theta, value=target.value, result=tcc))
return targets