afccp.main.CadetCareerProblem(data_name='Random', data_version='Default', degree_qual_type='Consistent', num_value_function_breakpoints=None, N=1600, M=32, P=6, S=10, generate_extra_components=False, generate_only_nrl=False, ctgan_model_name='CTGAN_Full', ctgan_pilot_sampling=False, printing=True)
¶
💼 Core Class: CadetCareerProblem
The CadetCareerProblem
class is the central engine behind the Air Force Cadet Career Problem (AFCCP).
It enables you to load, generate, solve, and export cadet-to-AFSC matching problems with full
flexibility for synthetic and historical data scenarios.
⚙️ Use Cases:
- Load existing instances from the
/instances
folder (e.g."2022b"
). - Generate new problem instances using
"Random"
or"CTGAN"
data. - Solve matching problems using classical or advanced optimization methods (e.g. VFT, GUO, GP).
- Visualize and export solution results for further analysis.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_name |
str
|
Name of the instance. Can be: - Existing instance name (e.g., |
'Random'
|
data_version |
str
|
Sub-version of the instance (optional). |
'Default'
|
degree_qual_type |
str
|
Qualification structure; one of |
'Consistent'
|
num_value_function_breakpoints |
int | None
|
Optional number of breakpoints to override existing value function definitions. |
None
|
N |
int
|
Number of cadets to generate (synthetic only). |
1600
|
M |
int
|
Number of AFSCs to generate. |
32
|
P |
int
|
Number of preferences per cadet. |
6
|
S |
int
|
Number of bases to generate. |
10
|
generate_extra_components |
bool
|
Whether to include bases and extra data. |
False
|
generate_only_nrl |
bool
|
Restrict AFSCs to NRLs only. |
False
|
ctgan_model_name |
str
|
Model to use for CTGAN generation. |
'CTGAN_Full'
|
ctgan_pilot_sampling |
bool
|
Condition sampling on pilot preferences in CTGAN. |
False
|
printing |
bool ---
|
Whether to print status updates. |
True
|
📦 Attributes¶
parameters (dict)
: Core cadet, AFSC, and preference datavalue_parameters (dict)
: Active value function weights and breakpointssolutions (dict)
: Stored solutions by namesolution (dict)
: Currently active solutionmdl_p (dict)
: Modeling parameters (for optimization)gp_df (pd.DataFrame)
: Goal Programming dataframe (if applicable)
💡 Example¶
# Generate a synthetic problem instance
instance = CadetCareerProblem(data_name="Random", N=300, M=12, P=5)
# Fix generated data by adding & correcting parameters, value parameters
instance.fix_generated_data()
# Solve using VFT optimization
instance.solve_vft_pyomo_model()
# Export results to Excel
instance.export_solution_results()
Automatic Import Behavior
If data_name
matches a folder in /instances
, the problem will auto-load that instance's data.
Otherwise, it will generate a synthetic instance.
Need Quick Test Data?
Use data_name="Random"
and N=50
to generate a fast demo instance for rapid prototyping.
For a tailored guide on the use of this object, please refer to Tutorial 1.
🛠 See Also¶
solve_vft_pyomo_model
,solve_guo_pyomo_model
,solve_gp_pyomo_model
reset_functional_parameters
,export_data
,measure_solution
- Module:
afccp.data.processing
for import/export logic
Source code in afccp/main.py
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 200 201 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 270 271 272 273 274 275 276 277 278 279 |
|