data.values
¶
Value Parameter Processing Module for AFCCP¶
This module manages the construction, manipulation, transformation, and comparison of value parameters
for the CadetCareerProblem
object. Value parameters define the objectives, weights,
and nonlinear utility functions used to evaluate cadet-to-AFSC assignments under Value-Focused Thinking (VFT)
and Goal Programming (GP) frameworks.
The functions in this module enable dynamic adjustment of value preferences, conversion between modeling formats, and consistent export or validation of weight/value configurations for modeling, diagnostics, or user inspection.
Main Functionalities¶
- Build and scale value functions based on cadet and AFSC preferences
- Generate AFOCD-based weights and objectives using tiered education alignment
- Update and regenerate weights and utility functions after changes
- Condense redundant value function breakpoints for speed and clarity
- Translate between VFT and Goal Programming formats (e.g., for GP solver compatibility)
- Export value parameters to Excel for audit and transparency
- Compare multiple value parameter sets for consistency diagnostics
Key Concepts¶
- Value Parameters: Contain objective weights, utility functions, and constraints used in the optimization.
- Breakpoints: Discrete x/y points used to approximate nonlinear value functions.
- Objective Types: Tier-based education goals, demographic balancing, quota constraints, cadet merit, etc.
- Constraint Types: Enforce structural bounds (e.g., minimum quotas, tier alignment).
- AFOCD Alignment: Relates cadet degrees (via CIP codes) to tiered AFSC requirements.
- Merit-Based Assignment: Rewards cadet-AFSC matches according to percentile rank.
Available Functions¶
update_value_and_weight_functions
β Rebuilds weight/value functions after updatesvalue_function_builder
β Generates piecewise exponential approximations of utility functionsgenerate_afocd_value_parameters
β Applies AFOCD rules to populate objective targets and constraintsmodel_value_parameters_to_defaults
β Exports value parameter set to Excel for auditingcompare_value_parameters
β Compares two value parameter dictionaries for equivalencycondense_value_functions
β Removes redundant zeros in piecewise value functionstranslate_vft_to_gp_parameters
β Converts VFT model structure to Goal Programming inputs
value_parameters_sets_additions(parameters, value_parameters, printing=False)
¶
Enhances the value_parameters
dictionary by adding derived sets and metadata required
for optimization and constraint evaluation in the cadet-AFSC matching problem.
This function precomputes various subset structures (e.g., AFSCs relevant to specific objectives, cadets with utility constraints, constrained objectives, etc.) to avoid unnecessary computation during model solving and value function evaluations.
Parameters¶
parameters : dict Dictionary of fixed model parameters (cadets, AFSCs, quotas, preferences, etc.). value_parameters : dict Dictionary of value model parameters including objectives, weights, constraints, and utility functions. printing : bool, optional Whether to print diagnostic output during execution. Default is False.
Returns¶
dict
Updated value_parameters
dictionary with added sets and utility matrices, including:
-
K
: np.ndarray Indices for all objectives -
K^A[j]
: dict[int β np.ndarray] Objectives with non-zero weights for AFSCj
-
K^C[j]
: dict[int β np.ndarray] Constrained objectives (non-zero constraint types) for AFSCj
-
J^A[k]
: dict[int β np.ndarray] AFSCs that include objectivek
-
I^C
: np.ndarray Cadets with value constraints (non-zero minimum value) -
J^Top_Choice[i]
: dict[int β np.ndarray] Preferred AFSCs for cadeti
that satisfy the cadet's value constraint -
J^C
: np.ndarray AFSCs with value constraints -
r[j, k]
: np.ndarray Number of breakpoints in the value function for AFSCj
and objectivek
-
L[j][k]
: np.ndarray Indices for breakpoints in the value function -
objective_min
,objective_max
: np.ndarray Lower and upper bounds on constrained objectives by AFSC -
global_utility
: np.ndarray Combined cadet and AFSC utility used for global utility optimization (if available)
Notes¶
- The function corrects legacy constraint types (3 and 4 β 1 and 2 respectively).
- It supports objectives tied to cadet demographics such as
USAFA Proportion
, andTier
objectives. - The function also scales and rounds weights for numerical stability.
Source code in afccp/data/values.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
model_value_parameters_to_defaults(instance, filepath, printing=False)
¶
Export Instance Value Parameters to Excel Defaults File.
This function extracts the current value parameters from the provided AFCCP model instance
and saves them into a structured Excel file. This allows users to export and preserve
a particular configuration of value weights, objectives, and constraints for cadets and AFSCs.
Parameters:¶
- instance (
CadetCareerProblem
): The current problem instance containing value parameters ininstance.value_parameters
. - filepath (str): Full path (including
.xlsx
extension) where the Excel file will be saved. - printing (bool, optional): If True, prints progress message during export. Default is False.
Returns:¶
None: Saves structured Excel file to disk with sheets for overall weights, AFSC weights, and objective components.
Examples:¶
model_value_parameters_to_defaults(instance, filepath='outputs/vp_defaults.xlsx', printing=True)
Source code in afccp/data/values.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
|
generate_afocd_value_parameters(parameters, default_value_parameters)
¶
Generate AFOCD-Based Value Parameters for AFSC Assignment.
This function builds out the objective weights, targets, and constraints for each AFSC based on their tiered degree requirements as specified in the AFOCD (Air Force Officer Classification Directory). Each tier (1β4) contributes differently based on whether the degree requirement is Mandatory, Desired, or Permitted.
The function modifies the provided value parameters dictionary in-place by populating:
objective_weight
objective_target
objective_value_min
constraint_type
value_functions
It uses multipliers for tier importance and maps the degree tier qualifications to model-ready value and constraint settings.
Parameters:¶
- parameters (dict): Problem instance parameters dictionary (contains tier structure, tier types, and tier proportions).
- default_value_parameters (dict): Template or pre-initialized dictionary of value parameters to be modified and returned.
Returns:¶
- dict: Updated
default_value_parameters
dictionary with AFOCD-based settings applied.
Examples:¶
```python updated_value_parameters = generate_afocd_value_parameters(instance.parameters, default_vp)
Source code in afccp/data/values.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
|
update_value_and_weight_functions(instance, num_breakpoints=None)
¶
Update Value and Weight Functions for the Current Value Parameter Set.
This function recalculates the cadet weights, AFSC weights, and value function breakpoints
(a
and f^hat
) for the currently loaded set of value parameters in the instance. It is useful
for refreshing value structures after manual edits to the value parameters, such as changes
in weight functions or objective targets.
It does not add or remove objectives from the current set β only updates the internal structure based on the existing configuration. For structural changes (adding/removing objectives), you must reinitialize the value parameter set entirely.
Parameters:¶
- instance (CadetCareerProblem): The active problem instance containing
parameters
andvalue_parameters
. - num_breakpoints (int, optional): Number of breakpoints used to approximate the nonlinear value functions. If not specified, defaults to internal value function settings.
Returns:¶
- dict: The updated
value_parameters
dictionary with recalculated weights and piecewise linear segments.
Examples:¶
instance.value_parameters = update_value_and_weight_functions(instance, num_breakpoints=10)
See Also:¶
cadet_weight_function
: Generates cadet weights from merit scores using a user-defined weighting function.afsc_weight_function
: Generates AFSC weights based on PGL using either 'Linear', 'Square', or 'Custom' mappings.value_function_builder
: Builds piecewise linear approximations (a
,f^hat
) of nonlinear value functions.create_segment_dict_from_string
: Parses the string representation of a value function and returns a segment definition.
Source code in afccp/data/values.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
|
generate_value_parameters_from_defaults(parameters, default_value_parameters, generate_afsc_weights=True, num_breakpoints=None, printing=False)
¶
Generates structured value parameters for the assignment problem based on the factory defaults.
This function constructs a complete vp
dictionary used by value-focused optimization models.
It loads and modifies default parameters to match the structure and constraints of the current
problem instance, accounting for objective targets, weights, breakpoints, and constraint types.
Note
- If
Qual Type
is"Tiers"
, the function replaces legacy AFOCD objectives with Tiered ones. - If
Qual Type
is"Relaxed"
, Tier objectives are removed.
Note
Use this function when you have:
- Loaded default value parameters from Excel
- A structured cadet-AFSC assignment problem (
parameters
) - Need to prepare a consistent set of inputs for a value-based matching model (e.g., VFT)
Parameters¶
parameters : dict Dictionary of instance parameters (cadets, AFSCs, quotas, preferences, etc.).
default_value_parameters : dict
Dictionary of default value parameters imported via default_value_parameters_from_excel
.
generate_afsc_weights : bool, optional If True (default), compute AFSC weights using the specified function in defaults. If False, use static AFSC weights from the defaults (used for "Custom").
num_breakpoints : int, optional Number of breakpoints used to discretize value functions. Defaults to what's in defaults.
printing : bool, optional Whether to print status updates during generation (default is False).
Returns¶
dict
A structured dictionary vp
containing:
objectives
: List of active objective namesobjective_weight
: Array of objective weights by AFSCobjective_target
: Array of target values for each AFSC-objective pairobjective_value_min
: Text bounds for constrained objectivesconstraint_type
: Type of constraint (e.g., inequality, convex) for each objectiveafsc_weight
,afsc_value_min
,cadet_weight
,cadets_overall_weight
, ...a
,f^hat
: Piecewise value function breakpointsK^A
: Dictionary mapping AFSC index to active objective indices
Source code in afccp/data/values.py
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 |
|
default_value_parameters_from_excel(filepath, num_breakpoints=24, printing=False)
¶
Loads the factory default value parameters from an Excel file into a structured dictionary.
This function is typically used to initialize a consistent baseline for value-focused models (such as VFT and GP), including AFSC weights, objective weights/targets, constraint types, and breakpoint-based value functions.
It pulls multiple sheets from a specified Excel file and organizes them into a structured dictionary suitable for assignment model optimization.
Note
The filepath
must point to a valid Excel file containing the following sheets:
- "Overall Weights"
- "AFSC Weights"
- "AFSC Objective Weights"
- "AFSC Objective Targets"
- "AFSC Objective Min Value"
- "Constraint Type"
- "Value Functions"
Parameters¶
filepath : str Path to the Excel file containing all value parameter sheets. num_breakpoints : int, optional Number of breakpoints to use for piecewise value functions (default is 24). printing : bool, optional Whether to print status messages during execution (default is False).
Returns¶
dict A dictionary containing all default value parameter arrays and scalars:
cadet_weight_function
: strafsc_weight_function
: strcadets_overall_weight
: floatafscs_overall_weight
: floatafsc_weight
: np.ndarrayobjective_weight
: np.ndarrayobjective_target
: np.ndarrayobjective_value_min
: np.ndarrayconstraint_type
: np.ndarrayvalue_functions
: np.ndarraycadets_overall_value_min
: floatafscs_overall_value_min
: floatafsc_value_min
: np.ndarrayobjectives
: np.ndarray of objective namescomplete_afscs
: np.ndarray of AFSC namesnum_breakpoints
: int (copied from input)M
: int (number of AFSCs)
Source code in afccp/data/values.py
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 |
|
cadet_weight_function(merit, func='Curve_1')
¶
Take in a merit array and generate cadet weights depending on function specified
Source code in afccp/data/values.py
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 |
|
afsc_weight_function(quota, func='Curve')
¶
Take in an AFSC quota array and generate AFSC weights depending on function specified
Source code in afccp/data/values.py
845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 |
|
create_segment_dict_from_string(vf_string, target=None, maximum=None, actual=None, multiplier=False, minimum=None)
¶
Converts a value function string into a segment dictionary.
Args:
- vf_string (str): Value function string.
- target (float, optional): Target objective measure.
- maximum (float, optional): Maximum objective measure.
- actual (float, optional): Proportion of eligible cadets.
- multiplier (bool, optional): Specifies whether the target values are multiplied by a scalar for quota objectives.
- minimum (float, optional): Minimum objective measure.
Returns: segment_dict (dict): A dictionary representing the segments of the value function.
Notes:
- The function assumes that the value function string follows a specific format.
- The segment dictionary contains keys representing the segment number and values representing the segment details.
-
Each segment is represented by a dictionary with the following keys:
- 'x1': The starting point on the x-axis.
- 'y1': The starting point on the y-axis.
- 'x2': The ending point on the x-axis.
- 'y2': The ending point on the y-axis.
- 'rho': The value of the rho parameter for the segment.
Source code in afccp/data/values.py
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 |
|
value_function_builder(segment_dict=None, num_breakpoints=None, derivative_locations=False)
¶
Build Piecewise Linear Value Function from Exponential Segments.
This function takes a dictionary of exponential segment definitions and returns a pair of
arrays representing the piecewise linear approximation of the nonlinear value function:
one for the x-axis breakpoints (a
) and one for the corresponding values (f^hat
).
The segment dictionary defines the start and end points, curvature (via rho
), and optionally
the number of breakpoints to use for each segment. The function supports both fixed-interval
spacing along the x-axis and derivative-based breakpoint spacing.
Parameters:¶
-
segment_dict (dict, optional): A dictionary specifying exponential segments. Each key maps to a sub-dictionary with:
'x1'
,'y1'
: Starting point of the segment'x2'
,'y2'
: Ending point of the segment'rho'
: Curvature parameter controlling steepness of the segment'r'
(optional): Number of breakpoints for this segment- num_breakpoints (int, optional): Overrides the per-segment breakpoint count. Distributes breakpoints equally if specified.
- derivative_locations (bool, optional): If True, breakpoints are spaced using derivative intervals instead of uniform spacing on the x-axis.
Returns:¶
- a (np.ndarray): Array of breakpoint locations (measures) on the x-axis.
- fhat (np.ndarray): Array of function values at those breakpoint locations.
Examples:¶
segment_def = {
1: {'x1': 0, 'y1': 0, 'x2': 0.5, 'y2': 1, 'rho': 0.1, 'r': 10},
2: {'x1': 0.5, 'y1': 1, 'x2': 1, 'y2': 0, 'rho': -0.1, 'r': 10}
}
a, fhat = value_function_builder(segment_def, num_breakpoints=20, derivative_locations=False)
See Also:¶
exponential_function
: Computes the value for an exponential segment at a given x.derivative_function
: Returns the derivative of the exponential function at a given x.inverse_derivative_function
: Finds the x-value corresponding to a specific derivative magnitude for exponential functions.
Source code in afccp/data/values.py
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 |
|
exponential_function(x, x_i, x_f, rho, positive)
¶
This function returns the value obtained from the specified exponential value function
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
current x |
required | |
x_i |
initial x from segment |
required | |
x_f |
final x from segment |
required | |
rho |
rho parameter |
required | |
positive |
if we have an increasing function or not |
required |
Returns:
Type | Description |
---|---|
current y |
Source code in afccp/data/values.py
1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 |
|
derivative_function(x, x_f, rho, positive)
¶
This function calculates the derivative of x for some point along a line segment
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
some x |
required | |
x_f |
final x from segment |
required | |
rho |
rho parameter |
required | |
positive |
if we have an increasing function or not |
required |
Returns:
Type | Description |
---|---|
y_prime |
Source code in afccp/data/values.py
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 |
|
inverse_derivative_function(y_prime, x_f, rho, positive)
¶
This function calculates the position of x based on its derivative
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y_prime |
first derivative of x |
required | |
x_f |
final x from segment |
required | |
rho |
rho parameter |
required | |
positive |
if we have an increasing function or not |
required |
Returns:
Type | Description |
---|---|
x |
Source code in afccp/data/values.py
1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 |
|
condense_value_functions(parameters, value_parameters)
¶
Remove Redundant Zero Segments in Value Functions.
This procedure cleans up the value function breakpoints (a
, f^hat
) by removing
unnecessary internal segments where the value remains zero, which do not affect
the overall utility calculation but may clutter the optimization model.
Parameters:¶
- parameters (dict): Dictionary of cadet/AFSC parameters (e.g.,
J
,K^A
, etc.). -
value_parameters (dict): Dictionary of value and weight parameter arrays, including:
a
: Breakpoint measures (list of lists by AFSC and objective index)f^hat
: Breakpoint values (list of lists by AFSC and objective index)
Returns:¶
- value_parameters (dict): Updated dictionary with condensed
a
andf^hat
arrays, where redundant zero-valued breakpoints have been removed.
Examples:¶
new_value_parameters = condense_value_functions(parameters, value_parameters)
Source code in afccp/data/values.py
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 |
|
compare_value_parameters(parameters, vp1, vp2, vp1name, vp2name, printing=False)
¶
Compare Two Sets of Value Parameters for Equality.
This function compares two dictionaries of value parameters used in cadet-AFSC utility modeling. It checks structural consistency (array shapes) and content equality across keys that define objective weights, constraints, value functions, and other relevant configurations.
Parameters:¶
- parameters (dict): The shared cadet-AFSC parameter dictionary used for indexing and labels.
- vp1 (dict): The first value parameter dictionary to compare.
- vp2 (dict): The second value parameter dictionary to compare.
- vp1name (str): Name label for the first value parameter set (used in print statements).
- vp2name (str): Name label for the second value parameter set (used in print statements).
- printing (bool, optional): If True, prints the first detected mismatch with context. Default is False.
Returns:¶
- identical (bool): True if all structure and content matches exactly between the two value parameter sets; False otherwise.
Examples:¶
result = compare_value_parameters(p, vp_baseline, vp_candidate, 'Baseline', 'Candidate', printing=True)
if not result:
print("Differences found between value parameter sets.")
Source code in afccp/data/values.py
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 |
|
translate_vft_to_gp_parameters(instance)
¶
Translates VFT (Value-Focused Thinking) Parameters to Goal Programming (GP) Model Parameters.
This function maps the VFT-based cadet-AFSC assignment model parameters stored in a CadetCareerProblem
instance into a format suitable for a separate goal programming model structure (e.g., Rebecca's model).
It builds constraint sets, cadet eligibility mappings, parameter values, and associated reward/penalty weights.
Parameters¶
-
instance : CadetCareerProblem An instance containing:
parameters
(dict): Core cadet and AFSC parameter structures.value_parameters
(dict): Weighting schemes, objective values, and constraints.gp_df
(DataFrame): Reward and penalty configurations used in GP model.
Returns¶
-
gp : dict A dictionary of goal programming model parameters with the following structure:
-
Sets:
A
,C
,A^
,C^
for AFSCs and Cadets by constraint type. - Parameters:
param
for bounds and targets,utility
,merit
,Big_M
,u_limit
. - Reward/Penalty:
lam^
,mu^
representing incentive structures. - Constraint Types:
con
defines the list of all modeled constraints.
Notes¶
- The model assumes AFSCs are indexed by
A
(0 to M-1), cadets byC
(0 to N-1). -
Constraint types include:
T
: Target quotas (min)F
: Over-classification limits (max)M
,D_under
,D_over
,P
: Education tier constraintsU_under
,U_over
: Bounds on USAFA proportionsR_under
,R_over
: Percentile constraints (e.g., merit)W
: Minimum preference coverage- Cadetsβ eligible and expressed-preference AFSCs are stored in
A^['E']
andA^['W^E']
. lam^['S']
rewards assignments that match cadet preferences in order of merit.- Constraint-specific cadet sets are available via
C^[con]
, e.g.,C^['D_under']
.
Examples¶
gp_parameters = translate_vft_to_gp_parameters(instance)
Source code in afccp/data/values.py
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 |
|