Fix: Ensure sample portfolio paths are always generated
Browse files
app.py
CHANGED
|
@@ -88,14 +88,14 @@ def run_simulation(
|
|
| 88 |
if not simulation_failed_this_run:
|
| 89 |
success_count += 1
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
|
| 94 |
success_probability = success_count / num_simulations
|
| 95 |
all_results.append({'swr': swr, 'success_rate': success_probability})
|
| 96 |
|
| 97 |
-
|
| 98 |
-
|
| 99 |
|
| 100 |
final_swr = 0.0
|
| 101 |
initial_annual_withdrawal_amount = 0.0
|
|
|
|
| 88 |
if not simulation_failed_this_run:
|
| 89 |
success_count += 1
|
| 90 |
|
| 91 |
+
# Always append path, we'll select a sample later
|
| 92 |
+
current_swr_paths.append(path)
|
| 93 |
|
| 94 |
success_probability = success_count / num_simulations
|
| 95 |
all_results.append({'swr': swr, 'success_rate': success_probability})
|
| 96 |
|
| 97 |
+
# Store a sample of paths for this SWR
|
| 98 |
+
portfolio_paths_for_plotting[swr] = current_swr_paths[:100] # Store up to 100 paths
|
| 99 |
|
| 100 |
final_swr = 0.0
|
| 101 |
initial_annual_withdrawal_amount = 0.0
|