-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinputs.cpp
1116 lines (1029 loc) · 51.8 KB
/
inputs.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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
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
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
361
362
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
466
467
468
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
724
725
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
814
815
816
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
843
844
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
889
890
891
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
#include <utility>
//
// Created by Jamie Cohen on 12/4/17.
//
#include "inputs.h"
using namespace std;
Inputs::Inputs(string Output, string Data){
OutputFolder = std::move(Output);
DataFolder = std::move(Data);
}
void Inputs::loadData(ifstream &Infile, vector< vector<double> > &VariableName) {
string line;
while(getline(Infile, line, '\r')){
string tab_delim;
vector<double> v1;
stringstream row(line);
while(getline(row, tab_delim))
{
stringstream ss(tab_delim);
double value;
while(ss>>value){
v1.push_back(value);
}
}
VariableName.push_back(v1);
}
}
void Inputs::loadRFG(string &RunsFileName, string &CurKey) {
//GLOBAL CONSTANTS
//[ModelSpecifications] variable names
string OutputDirName = "OutputDir";
string CohortSizeName = "CohortSize";
string ModelStartAgeName = "ModelStartAge";
string ModelStopAgeName = "ModelStopAge";
string StartYearName = "StartYear";
string SimulationYearsName = "SimulationYears";
string BurnInYearsName = "BurnInYears";
string InitialPopulationFileName = "InitialPopulationFile";
//[NaturalHistory] variable names
//Natural History related distributions
//e.g. string TableExampleFileName = "TableExampleFile";
string ASRMortalityFileName = "ASRMortalityFile";
string HPVIncidenceFileName = "HPVIncidenceFile";
string HPVProgressionFileName = "HPVProgressionFile";
string HPVClearanceFileName = "HPVClearanceFile";
string CINProgressionFileName = "CINProgressionFile";
string CINRegressionFileName = "CINRegressionFile";
string CaMortalityFileName = "CaMortalityFile";
string SymptomDetectionFileName = "SymptomDetectionFile";
// Interventions
string CostsFileName = "CostsFile";
string DisabilityFileName = "DisabilityFile";
string LifeExpectancyFileName = "LifeExpectancyFile";
string ScreenStopAgeName = "ScreenStopAge";
string ScreenStartAgeName = "ScreenStartAge";
string ScreenFrequencyName = "ScreenFrequency";
string ScreenCoverageName = "ScreenCoverage";
string ScreenComplianceName = "ScreenCompliance";
string VaccineCoverageName = "VaccineCoverage";
string MechanismofImmunityName = "MechanismofImmunity";
string LatencyName = "Latency";
string WaningImmunityName = "WaningImmunity";
string ImmuneDurationName = "ImmuneDuration";
string ImmuneWaneTimeName = "ImmuneWaneTime";
string VaccineTypeName = "VaccineType";
string VaccineEfficacyPriorName = "VaccineEfficacyPrior";
string VaccineStartAgeName = "VaccineStartAge";
string VaccineEndAgeName = "VaccineEndAge";
string VaccineStartYearName = "VaccineStartYear";
string VaccineEfficacyFileName = "VaccineEfficacyFile";
string VaccineDurationName = "VaccineDuration";
string VaccineWaneTimeName = "VaccineWaneTime";
string CytoSensFileName = "CytoSensFile";
string ColpoSensFileName = "ColpoSensFile";
string LLETZSuccessRateCINName = "LLETZSuccessRateCIN";
string LLETZSuccessRateHPVName = "LLETZSuccessRateHPV";
string AdequacyLBCName = "AdequacyLBC";
string ColpoAvailName = "ColpoAvail";
string dwelltime_outputName = "dwelltime_output";
string incidence_outputName = "incidence_output";
string mortality_outputName = "mortality_output";
string CEA_outputName = "CEA_output";
//[Multipliers] variable names
//[NaturalImmunity Multipliers] variable names
string CIN2_NL_allother_1Name = "CIN2_NL_allother_1";
string CIN2_NL_allother_2_4Name = "CIN2_NL_allother_2_4";
string CIN2_NL_allother_5Name = "CIN2_NL_allother_5";
string CIN2_NL_16_1Name = "CIN2_NL_16_1";
string CIN2_NL_16_2_4Name = "CIN2_NL_16_2_4";
string CIN2_NL_16_5Name = "CIN2_NL_16_5";
string HPV_NL_LR_1Name = "HPV_NL_LR_1";
string HPV_NL_LR_2_4Name = "HPV_NL_LR_2_4";
string HPV_NL_LR_5Name = "HPV_NL_LR_5";
string HPV_NL_otherHR_1Name = "HPV_NL_otherHR_1";
string HPV_NL_otherHR_2_4Name = "HPV_NL_otherHR_2_4";
string HPV_NL_otherHR_5Name = "HPV_NL_otherHR_5";
string HPV_NL_high5_1Name = "HPV_NL_high5_1";
string HPV_NL_high5_2_4Name = "HPV_NL_high5_2_4";
string HPV_NL_high5_5Name = "HPV_NL_high5_5";
string HPV_NL_16_1Name = "HPV_NL_16_1";
string HPV_NL_16_2_4Name = "HPV_NL_16_2_4";
string HPV_NL_16_5Name = "HPV_NL_16_5";
string HPV_NL_18_1Name = "HPV_NL_18_1";
string HPV_NL_18_2_4Name = "HPV_NL_18_2_4";
string HPV_NL_18_5Name = "HPV_NL_18_5";
string HPV_CIN_LR_1Name = "HPV_CIN_LR_1";
string HPV_CIN_LR_2_4Name = "HPV_CIN_LR_2_4";
string HPV_CIN_LR_5Name = "HPV_CIN_LR_5";
string HPV_CIN_otherHR_1Name = "HPV_CIN_otherHR_1";
string HPV_CIN_otherHR_2_4Name = "HPV_CIN_otherHR_2_4";
string HPV_CIN_otherHR_5Name = "HPV_CIN_otherHR_5";
string HPV_CIN_high5_1Name = "HPV_CIN_high5_1";
string HPV_CIN_high5_2_4Name = "HPV_CIN_high5_2_4";
string HPV_CIN_high5_5Name = "HPV_CIN_high5_5";
string HPV_CIN_16_1Name = "HPV_CIN_16_1";
string HPV_CIN_16_2_4Name = "HPV_CIN_16_2_4";
string HPV_CIN_16_5Name = "HPV_CIN_16_5";
string HPV_CIN_18_1Name = "HPV_CIN_18_1";
string HPV_CIN_18_2_4Name = "HPV_CIN_18_2_4";
string HPV_CIN_18_5Name = "HPV_CIN_18_5";
string CIN3_CA_high5_1_5Name = "CIN3_CA_high5_1_5";
string CIN3_CA_high5_6_10Name = "CIN3_CA_high5_6_10";
string CIN3_CA_high5_11_20Name = "CIN3_CA_high5_11_20";
string CIN3_CA_high5_21_30Name = "CIN3_CA_high5_21_30";
string CIN3_CA_high5_31_40Name = "CIN3_CA_high5_31_40";
string CIN3_CA_high5_41_50Name = "CIN3_CA_high5_41_50";
string CIN3_CA_high5_50Name = "CIN3_CA_high5_50";
string CIN3_CA_16_1_5Name = "CIN3_CA_16_1_5";
string CIN3_CA_16_6_10Name = "CIN3_CA_16_6_10";
string CIN3_CA_16_11_20Name = "CIN3_CA_16_11_20";
string CIN3_CA_16_21_30Name = "CIN3_CA_16_21_30";
string CIN3_CA_16_31_40Name = "CIN3_CA_16_31_40";
string CIN3_CA_16_41_50Name = "CIN3_CA_16_41_50";
string CIN3_CA_16_50Name = "CIN3_CA_16_50";
string CIN3_CA_18_1_5Name = "CIN3_CA_18_1_5";
string CIN3_CA_18_6_10Name = "CIN3_CA_18_6_10";
string CIN3_CA_18_11_20Name = "CIN3_CA_18_11_20";
string CIN3_CA_18_21_30Name = "CIN3_CA_18_21_30";
string CIN3_CA_18_31_40Name = "CIN3_CA_18_31_40";
string CIN3_CA_18_41_50Name = "CIN3_CA_18_41_50";
string CIN3_CA_18_50Name = "CIN3_CA_18_50";
string CIN3_CA_otherHR_1_5Name = "CIN3_CA_otherHR_1_5";
string CIN3_CA_otherHR_6_10Name = "CIN3_CA_otherHR_6_10";
string CIN3_CA_otherHR_11_20Name = "CIN3_CA_otherHR_11_20";
string CIN3_CA_otherHR_21_30Name = "CIN3_CA_otherHR_21_30";
string CIN3_CA_otherHR_31_40Name = "CIN3_CA_otherHR_31_40";
string CIN3_CA_otherHR_41_50Name = "CIN3_CA_otherHR_41_50";
string CIN3_CA_otherHR_50Name = "CIN3_CA_otherHR_50";
string NL_HPV16_17_19Name = "NL_HPV16_17_19";
string NL_HPV16_20_24Name = "NL_HPV16_20_24";
string NL_HPV16_25_29Name = "NL_HPV16_25_29";
string NL_HPV16_30_34Name = "NL_HPV16_30_34";
string NL_HPV16_35_39Name = "NL_HPV16_35_39";
string NL_HPV16_40_44Name = "NL_HPV16_40_44";
string NL_HPV16_45_49Name = "NL_HPV16_45_49";
string NL_HPV16_50_54Name = "NL_HPV16_50_54";
string NL_HPV16_55_65Name = "NL_HPV16_55_65";
string NL_HPV18_17_19Name = "NL_HPV18_17_19";
string NL_HPV18_20_24Name = "NL_HPV18_20_24";
string NL_HPV18_25_29Name = "NL_HPV18_25_29";
string NL_HPV18_30_34Name = "NL_HPV18_30_34";
string NL_HPV18_35_39Name = "NL_HPV18_35_39";
string NL_HPV18_40_44Name = "NL_HPV18_40_44";
string NL_HPV18_45_49Name = "NL_HPV18_45_49";
string NL_HPV18_50_54Name = "NL_HPV18_50_54";
string NL_HPV18_55_65Name = "NL_HPV18_55_65";
string NL_HPVhigh5_17_19Name = "NL_HPVhigh5_17_19";
string NL_HPVhigh5_20_24Name = "NL_HPVhigh5_20_24";
string NL_HPVhigh5_25_29Name = "NL_HPVhigh5_25_29";
string NL_HPVhigh5_30_34Name = "NL_HPVhigh5_30_34";
string NL_HPVhigh5_35_39Name = "NL_HPVhigh5_35_39";
string NL_HPVhigh5_40_44Name = "NL_HPVhigh5_40_44";
string NL_HPVhigh5_45_49Name = "NL_HPVhigh5_45_49";
string NL_HPVhigh5_50_54Name = "NL_HPVhigh5_50_54";
string NL_HPVhigh5_55_65Name = "NL_HPVhigh5_55_65";
string NL_HPVoHR_17_19Name = "NL_HPVoHR_17_19";
string NL_HPVoHR_20_24Name = "NL_HPVoHR_20_24";
string NL_HPVoHR_25_29Name = "NL_HPVoHR_25_29";
string NL_HPVoHR_30_34Name = "NL_HPVoHR_30_34";
string NL_HPVoHR_35_39Name = "NL_HPVoHR_35_39";
string NL_HPVoHR_40_44Name = "NL_HPVoHR_40_44";
string NL_HPVoHR_45_49Name = "NL_HPVoHR_45_49";
string NL_HPVoHR_50_54Name = "NL_HPVoHR_50_54";
string NL_HPVoHR_55_65Name = "NL_HPVoHR_55_65";
string NL_HPVLR_17_19Name = "NL_HPVLR_17_19";
string NL_HPVLR_20_24Name = "NL_HPVLR_20_24";
string NL_HPVLR_25_29Name = "NL_HPVLR_25_29";
string NL_HPVLR_30_34Name = "NL_HPVLR_30_34";
string NL_HPVLR_35_39Name = "NL_HPVLR_35_39";
string NL_HPVLR_40_44Name = "NL_HPVLR_40_44";
string NL_HPVLR_45_49Name = "NL_HPVLR_45_49";
string NL_HPVLR_50_54Name = "NL_HPVLR_50_54";
string NL_HPVLR_55_65Name = "NL_HPVLR_55_65";
string ImmuneDegreeName = "ImmuneDegree";
string ImmuneDegree16Name = "ImmuneDegree16";
string pRegresstoHPVName = "pRegresstoHPV";
string CIN3_NLName = "CIN3_NL";
string CIN2_CAName = "CIN2_CA";
string HPV_CIN2_16Name = "HPV_CIN2_16";
string HPV_CIN2_allotherName = "HPV_CIN2_allother";
string CA1_CA1dName = "CA1_CA1d";
string CA2_CA2dName = "CA2_CA2d";
string CA3_CA3dName = "CA3_CA3d";
string CA1_CA2Name = "CA1_CA2";
string CA2_CA3Name = "CA2_CA3";
string CalibTargsFileName = "CalibTargsFile";
string CalibTargsNamesFileName = "CalibTargsNamesFile";
string MultipliersFileName = "MultipliersFile";
string MultipliersNamesFileName = "MultipliersNamesFile";
string SimulationsName = "Simulations";
//READ IN DATA FROM INPUT FILE HERE FIRST
//create cinifile object and read it
CIniFile RunsFile(RunsFileName);
if (!RunsFile.ReadFile()) {
std::cerr << "\nError: Could not read Runs File: " << RunsFileName << endl;
exit(1);
}
//SET RUN VARIABLES AND MODEL SPECIFICATIONS
//a file stream
ifstream Infile;
//variable names
//e.g. StringExample.append(RunsFile.GetValue(CurKey, StringExampleName));
//e.g. IntExample = RunsFile.GetValueI(CurKey, IntExampleName);
//e.g. DoubleExample = RunsFile.GetValueF(CurKey, DoubleExampleName);
OutputDir = OutputFolder.append(RunsFile.GetValue(CurKey, OutputDirName));
CohortSize = RunsFile.GetValueI(CurKey, CohortSizeName);
ModelStartAge = RunsFile.GetValueI(CurKey, ModelStartAgeName);
ModelStopAge = RunsFile.GetValueI(CurKey, ModelStopAgeName);
StartYear = RunsFile.GetValueI(CurKey, StartYearName);
SimulationYears = RunsFile.GetValueI (CurKey, SimulationYearsName);
BurnInYears = RunsFile.GetValueI (CurKey, BurnInYearsName);
dwelltime_output = RunsFile.GetValueI(CurKey, dwelltime_outputName);
incidence_output = RunsFile.GetValueI(CurKey, incidence_outputName);
mortality_output = RunsFile.GetValueI(CurKey, mortality_outputName);
CEA_output = RunsFile.GetValueI(CurKey, CEA_outputName);
InitialPopulationFile.append(DataFolder);
InitialPopulationFile.append(RunsFile.GetValue(CurKey, InitialPopulationFileName));
Infile.open(InitialPopulationFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << InitialPopulationFile << endl;
exit(1);
}
loadData (Infile, InitialPopulation);
Infile.close();
Infile.clear();
CalibTargsFile.append(DataFolder);
CalibTargsFile.append(RunsFile.GetValue(CurKey, CalibTargsFileName));
Infile.open(CalibTargsFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CalibTargsFile << endl;
exit(1);
}
loadData (Infile, CalibTargs);
Infile.close();
Infile.clear();
MultipliersFile.append(DataFolder);
MultipliersFile.append(RunsFile.GetValue(CurKey, MultipliersFileName));
Infile.open(MultipliersFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << MultipliersFile << endl;
exit(1);
}
loadData (Infile, Multipliers);
Infile.close();
Infile.clear();
MultipliersNamesFile.append(DataFolder);
MultipliersNamesFile.append(RunsFile.GetValue(CurKey, MultipliersNamesFileName));
Infile.open(MultipliersNamesFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << MultipliersNamesFile << endl;
exit(1);
}
loadStringData (Infile, MultipliersNames);
Infile.close();
Infile.clear();
CalibTargsNamesFile.append(DataFolder);
CalibTargsNamesFile.append(RunsFile.GetValue(CurKey, CalibTargsNamesFileName));
Infile.open(CalibTargsNamesFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CalibTargsNamesFile << endl;
exit(1);
}
loadStringData (Infile, CalibTargsNames);
Infile.close();
Infile.clear();
Simulations = RunsFile.GetValueI (CurKey, SimulationsName);
HPVIncidenceFile.append(DataFolder);
HPVIncidenceFile.append(RunsFile.GetValue(CurKey, HPVIncidenceFileName));
Infile.open(HPVIncidenceFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << HPVIncidenceFile << endl;
exit(1);
}
loadData (Infile, HPVInc);
Infile.close();
Infile.clear();
HPVProgressionFile.append(DataFolder);
HPVProgressionFile.append(RunsFile.GetValue(CurKey, HPVProgressionFileName));
Infile.open(HPVProgressionFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << HPVProgressionFile << endl;
exit(1);
}
loadData (Infile, HPVProgression);
Infile.close();
Infile.clear();
HPVClearanceFile.append(DataFolder);
HPVClearanceFile.append(RunsFile.GetValue(CurKey, HPVClearanceFileName));
Infile.open(HPVClearanceFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << HPVClearanceFile << endl;
exit(1);
}
loadData (Infile, HPVClearance);
Infile.close();
Infile.clear();
CINProgressionFile.append(DataFolder);
CINProgressionFile.append(RunsFile.GetValue(CurKey, CINProgressionFileName));
Infile.open(CINProgressionFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CINProgressionFile << endl;
exit(1);
}
loadData (Infile, CINProgression);
Infile.close();
Infile.clear();
CINRegressionFile.append(DataFolder);
CINRegressionFile.append(RunsFile.GetValue(CurKey, CINRegressionFileName));
Infile.open(CINRegressionFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CINRegressionFile << endl;
exit(1);
}
loadData (Infile, CINRegression);
Infile.close();
Infile.clear();
ASRMortalityFile.append(DataFolder);
ASRMortalityFile.append(RunsFile.GetValue(CurKey, ASRMortalityFileName));
Infile.open(ASRMortalityFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << ASRMortalityFile << endl;
exit(1);
}
loadData (Infile, ASRMortality);
Infile.close();
Infile.clear();
CaMortalityFile.append(DataFolder);
CaMortalityFile.append(RunsFile.GetValue(CurKey, CaMortalityFileName));
Infile.open(CaMortalityFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CaMortalityFile << endl;
exit(1);
}
loadData (Infile, CaMortality);
Infile.close();
Infile.clear();
CostsFile.append(DataFolder);
CostsFile.append(RunsFile.GetValue(CurKey, CostsFileName));
Infile.open(CostsFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CostsFile << endl;
exit(1);
}
loadData (Infile, Costs);
Infile.close();
Infile.clear();
DisabilityFile.append(DataFolder);
DisabilityFile.append(RunsFile.GetValue(CurKey, DisabilityFileName));
Infile.open(DisabilityFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << DisabilityFile << endl;
exit(1);
}
loadData (Infile, Disability);
Infile.close();
Infile.clear();
LifeExpectancyFile.append(DataFolder);
LifeExpectancyFile.append(RunsFile.GetValue(CurKey, LifeExpectancyFileName));
Infile.open(LifeExpectancyFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << LifeExpectancyFile << endl;
exit(1);
}
loadData (Infile, LifeExpectancy);
Infile.close();
Infile.clear();
//[Interventions]
ScreenStartAge = RunsFile.GetValueI(CurKey, ScreenStartAgeName);
ScreenStopAge = RunsFile.GetValueI(CurKey, ScreenStopAgeName);
ScreenFrequency = RunsFile.GetValueI(CurKey, ScreenFrequencyName);
ScreenCoverage = RunsFile.GetValueF(CurKey, ScreenCoverageName);
ScreenCompliance = RunsFile.GetValueF(CurKey, ScreenComplianceName);
VaccineCoverage = RunsFile.GetValueF(CurKey, VaccineCoverageName);
VaccineType = RunsFile.GetValue(CurKey, VaccineTypeName);
VaccineEfficacyPrior = RunsFile.GetValueF(CurKey, VaccineEfficacyPriorName);
VaccineStartAge = RunsFile.GetValueI(CurKey, VaccineStartAgeName);
VaccineEndAge = RunsFile.GetValueI(CurKey, VaccineEndAgeName);
VaccineStartYear = RunsFile.GetValueI(CurKey, VaccineStartYearName);
VaccineDuration = RunsFile.GetValueI(CurKey, VaccineDurationName);
VaccineWaneTime = RunsFile.GetValueI(CurKey, VaccineWaneTimeName);
WaningImmunity = RunsFile.GetValueI(CurKey, WaningImmunityName);
VaccineEfficacyFile.append(DataFolder);
VaccineEfficacyFile.append(RunsFile.GetValue(CurKey, VaccineEfficacyFileName));
Infile.open(VaccineEfficacyFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << VaccineEfficacyFile << endl;
exit(1);
}
loadData (Infile, vaccineefficacy);
Infile.close();
Infile.clear();
CytoSensFile.append(DataFolder);
CytoSensFile.append(RunsFile.GetValue(CurKey, CytoSensFileName));
Infile.open(CytoSensFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << CytoSensFile << endl;
exit(1);
}
loadData (Infile, cytosens);
Infile.close();
Infile.clear();
ColpoSensFile.append(DataFolder);
ColpoSensFile.append(RunsFile.GetValue(CurKey, ColpoSensFileName));
Infile.open(ColpoSensFile, ios::in);
if(Infile.fail())
{
cerr << "\nError: Unable to open file: " << ColpoSensFile << endl;
exit(1);
}
loadData (Infile, colposens);
Infile.close();
Infile.clear();
LLETZSuccessRateCIN = RunsFile.GetValueF(CurKey, LLETZSuccessRateCINName);
LLETZSuccessRateHPV = RunsFile.GetValueF(CurKey, LLETZSuccessRateHPVName);
AdequacyLBC = RunsFile.GetValueF (CurKey, AdequacyLBCName);
ColpoAvail = RunsFile.GetValueF (CurKey, ColpoAvailName);
ImmuneWaneTime = RunsFile.GetValueI(CurKey, ImmuneWaneTimeName);
ImmuneDuration = RunsFile.GetValueI(CurKey, ImmuneDurationName);
MechanismofImmunity = RunsFile.GetValue (CurKey, MechanismofImmunityName);
Latency = RunsFile.GetValueI (CurKey, LatencyName);
// NEW PARAMETERS
CIN2_NL_allother_1 = RunsFile.GetValueF(CurKey, CIN2_NL_allother_1Name);
CIN2_NL_allother_2_4 = RunsFile.GetValueF(CurKey, CIN2_NL_allother_2_4Name);
CIN2_NL_allother_5 = RunsFile.GetValueF(CurKey, CIN2_NL_allother_5Name);
CIN2_NL_16_1 = RunsFile.GetValueF(CurKey, CIN2_NL_16_1Name);
CIN2_NL_16_2_4 = RunsFile.GetValueF(CurKey, CIN2_NL_16_2_4Name);
CIN2_NL_16_5 = RunsFile.GetValueF(CurKey, CIN2_NL_16_5Name);
HPV_NL_LR_1 = RunsFile.GetValueF(CurKey, HPV_NL_LR_1Name);
HPV_NL_LR_2_4 = RunsFile.GetValueF(CurKey, HPV_NL_LR_2_4Name);
HPV_NL_LR_5 = RunsFile.GetValueF(CurKey, HPV_NL_LR_5Name);
HPV_NL_otherHR_1 = RunsFile.GetValueF(CurKey, HPV_NL_otherHR_1Name);
HPV_NL_otherHR_2_4 = RunsFile.GetValueF(CurKey, HPV_NL_otherHR_2_4Name);
HPV_NL_otherHR_5 = RunsFile.GetValueF(CurKey, HPV_NL_otherHR_5Name);
HPV_NL_high5_1 = RunsFile.GetValueF(CurKey, HPV_NL_high5_1Name);
HPV_NL_high5_2_4 = RunsFile.GetValueF(CurKey, HPV_NL_high5_2_4Name);
HPV_NL_high5_5 = RunsFile.GetValueF(CurKey, HPV_NL_high5_5Name);
HPV_NL_16_1 = RunsFile.GetValueF(CurKey, HPV_NL_16_1Name);
HPV_NL_16_2_4 = RunsFile.GetValueF(CurKey, HPV_NL_16_2_4Name);
HPV_NL_16_5 = RunsFile.GetValueF(CurKey, HPV_NL_16_5Name);
HPV_NL_18_1 = RunsFile.GetValueF(CurKey, HPV_NL_18_1Name);
HPV_NL_18_2_4 = RunsFile.GetValueF(CurKey, HPV_NL_18_2_4Name);
HPV_NL_18_5 = RunsFile.GetValueF(CurKey, HPV_NL_18_5Name);
HPV_CIN_LR_1 = RunsFile.GetValueF(CurKey, HPV_CIN_LR_1Name);
HPV_CIN_LR_2_4 = RunsFile.GetValueF(CurKey, HPV_CIN_LR_2_4Name);
HPV_CIN_LR_5 = RunsFile.GetValueF(CurKey, HPV_CIN_LR_5Name);
HPV_CIN_otherHR_1 = RunsFile.GetValueF(CurKey, HPV_CIN_otherHR_1Name);
HPV_CIN_otherHR_2_4 = RunsFile.GetValueF(CurKey, HPV_CIN_otherHR_2_4Name);
HPV_CIN_otherHR_5 = RunsFile.GetValueF(CurKey, HPV_CIN_otherHR_5Name);
HPV_CIN_high5_1 = RunsFile.GetValueF(CurKey, HPV_CIN_high5_1Name);
HPV_CIN_high5_2_4 = RunsFile.GetValueF(CurKey, HPV_CIN_high5_2_4Name);
HPV_CIN_high5_5 = RunsFile.GetValueF(CurKey, HPV_CIN_high5_5Name);
HPV_CIN_16_1 = RunsFile.GetValueF(CurKey, HPV_CIN_16_1Name);
HPV_CIN_16_2_4 = RunsFile.GetValueF(CurKey, HPV_CIN_16_2_4Name);
HPV_CIN_16_5 = RunsFile.GetValueF(CurKey, HPV_CIN_16_5Name);
HPV_CIN_18_1 = RunsFile.GetValueF(CurKey, HPV_CIN_18_1Name);
HPV_CIN_18_2_4 = RunsFile.GetValueF(CurKey, HPV_CIN_18_2_4Name);
HPV_CIN_18_5 = RunsFile.GetValueF(CurKey, HPV_CIN_18_5Name);
CIN3_CA_high5_1_5 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_1_5Name);
CIN3_CA_high5_6_10 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_6_10Name);
CIN3_CA_high5_11_20 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_11_20Name);
CIN3_CA_high5_21_30 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_21_30Name);
CIN3_CA_high5_31_40 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_31_40Name);
CIN3_CA_high5_41_50 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_41_50Name);
CIN3_CA_high5_50 = RunsFile.GetValueF(CurKey, CIN3_CA_high5_50Name);
CIN3_CA_16_1_5 = RunsFile.GetValueF(CurKey, CIN3_CA_16_1_5Name);
CIN3_CA_16_6_10 = RunsFile.GetValueF(CurKey, CIN3_CA_16_6_10Name);
CIN3_CA_16_11_20 = RunsFile.GetValueF(CurKey, CIN3_CA_16_11_20Name);
CIN3_CA_16_21_30 = RunsFile.GetValueF(CurKey, CIN3_CA_16_21_30Name);
CIN3_CA_16_31_40 = RunsFile.GetValueF(CurKey, CIN3_CA_16_31_40Name);
CIN3_CA_16_41_50 = RunsFile.GetValueF(CurKey, CIN3_CA_16_41_50Name);
CIN3_CA_16_50 = RunsFile.GetValueF(CurKey, CIN3_CA_16_50Name);
CIN3_CA_18_1_5 = RunsFile.GetValueF(CurKey, CIN3_CA_18_1_5Name);
CIN3_CA_18_6_10 = RunsFile.GetValueF(CurKey, CIN3_CA_18_6_10Name);
CIN3_CA_18_11_20 = RunsFile.GetValueF(CurKey, CIN3_CA_18_11_20Name);
CIN3_CA_18_21_30 = RunsFile.GetValueF(CurKey, CIN3_CA_18_21_30Name);
CIN3_CA_18_31_40 = RunsFile.GetValueF(CurKey, CIN3_CA_18_31_40Name);
CIN3_CA_18_41_50 = RunsFile.GetValueF(CurKey, CIN3_CA_18_41_50Name);
CIN3_CA_18_50 = RunsFile.GetValueF(CurKey, CIN3_CA_18_50Name);
CIN3_CA_otherHR_1_5 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_1_5Name);
CIN3_CA_otherHR_6_10 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_6_10Name);
CIN3_CA_otherHR_11_20 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_11_20Name);
CIN3_CA_otherHR_21_30 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_21_30Name);
CIN3_CA_otherHR_31_40 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_31_40Name);
CIN3_CA_otherHR_41_50 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_41_50Name);
CIN3_CA_otherHR_50 = RunsFile.GetValueF(CurKey, CIN3_CA_otherHR_50Name);
NL_HPV16_17_19 = RunsFile.GetValueF(CurKey, NL_HPV16_17_19Name);
NL_HPV16_20_24 = RunsFile.GetValueF(CurKey, NL_HPV16_20_24Name);
NL_HPV16_25_29 = RunsFile.GetValueF(CurKey, NL_HPV16_25_29Name);
NL_HPV16_30_34 = RunsFile.GetValueF(CurKey, NL_HPV16_30_34Name);
NL_HPV16_35_39 = RunsFile.GetValueF(CurKey, NL_HPV16_35_39Name);
NL_HPV16_40_44 = RunsFile.GetValueF(CurKey, NL_HPV16_40_44Name);
NL_HPV16_45_49 = RunsFile.GetValueF(CurKey, NL_HPV16_45_49Name);
NL_HPV16_50_54 = RunsFile.GetValueF(CurKey, NL_HPV16_50_54Name);
NL_HPV16_55_65 = RunsFile.GetValueF(CurKey, NL_HPV16_55_65Name);
NL_HPV18_17_19 = RunsFile.GetValueF(CurKey, NL_HPV18_17_19Name);
NL_HPV18_20_24 = RunsFile.GetValueF(CurKey, NL_HPV18_20_24Name);
NL_HPV18_25_29 = RunsFile.GetValueF(CurKey, NL_HPV18_25_29Name);
NL_HPV18_30_34 = RunsFile.GetValueF(CurKey, NL_HPV18_30_34Name);
NL_HPV18_35_39 = RunsFile.GetValueF(CurKey, NL_HPV18_35_39Name);
NL_HPV18_40_44 = RunsFile.GetValueF(CurKey, NL_HPV18_40_44Name);
NL_HPV18_45_49 = RunsFile.GetValueF(CurKey, NL_HPV18_45_49Name);
NL_HPV18_50_54 = RunsFile.GetValueF(CurKey, NL_HPV18_50_54Name);
NL_HPV18_55_65 = RunsFile.GetValueF(CurKey, NL_HPV18_55_65Name);
NL_HPVhigh5_17_19 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_17_19Name);
NL_HPVhigh5_20_24 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_20_24Name);
NL_HPVhigh5_25_29 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_25_29Name);
NL_HPVhigh5_30_34 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_30_34Name);
NL_HPVhigh5_35_39 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_35_39Name);
NL_HPVhigh5_40_44 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_40_44Name);
NL_HPVhigh5_45_49 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_45_49Name);
NL_HPVhigh5_50_54 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_50_54Name);
NL_HPVhigh5_55_65 = RunsFile.GetValueF(CurKey, NL_HPVhigh5_55_65Name);
NL_HPVoHR_17_19 = RunsFile.GetValueF(CurKey, NL_HPVoHR_17_19Name);
NL_HPVoHR_20_24 = RunsFile.GetValueF(CurKey, NL_HPVoHR_20_24Name);
NL_HPVoHR_25_29 = RunsFile.GetValueF(CurKey, NL_HPVoHR_25_29Name);
NL_HPVoHR_30_34 = RunsFile.GetValueF(CurKey, NL_HPVoHR_30_34Name);
NL_HPVoHR_35_39 = RunsFile.GetValueF(CurKey, NL_HPVoHR_35_39Name);
NL_HPVoHR_40_44 = RunsFile.GetValueF(CurKey, NL_HPVoHR_40_44Name);
NL_HPVoHR_45_49 = RunsFile.GetValueF(CurKey, NL_HPVoHR_45_49Name);
NL_HPVoHR_50_54 = RunsFile.GetValueF(CurKey, NL_HPVoHR_50_54Name);
NL_HPVoHR_55_65 = RunsFile.GetValueF(CurKey, NL_HPVoHR_55_65Name);
NL_HPVLR_17_19 = RunsFile.GetValueF(CurKey, NL_HPVLR_17_19Name);
NL_HPVLR_20_24 = RunsFile.GetValueF(CurKey, NL_HPVLR_20_24Name);
NL_HPVLR_25_29 = RunsFile.GetValueF(CurKey, NL_HPVLR_25_29Name);
NL_HPVLR_30_34 = RunsFile.GetValueF(CurKey, NL_HPVLR_30_34Name);
NL_HPVLR_35_39 = RunsFile.GetValueF(CurKey, NL_HPVLR_35_39Name);
NL_HPVLR_40_44 = RunsFile.GetValueF(CurKey, NL_HPVLR_40_44Name);
NL_HPVLR_45_49 = RunsFile.GetValueF(CurKey, NL_HPVLR_45_49Name);
NL_HPVLR_50_54 = RunsFile.GetValueF(CurKey, NL_HPVLR_50_54Name);
NL_HPVLR_55_65 = RunsFile.GetValueF(CurKey, NL_HPVLR_55_65Name);
ImmuneDegree = RunsFile.GetValueF(CurKey, ImmuneDegreeName);
ImmuneDegree16 = RunsFile.GetValueF(CurKey, ImmuneDegree16Name);
pRegresstoHPV = RunsFile.GetValueF(CurKey, pRegresstoHPVName);
CIN3_NL = RunsFile.GetValueF(CurKey, CIN3_NLName);
CIN2_CA = RunsFile.GetValueF(CurKey, CIN2_CAName);
HPV_CIN2_16 = RunsFile.GetValueF(CurKey, HPV_CIN2_16Name);
HPV_CIN2_allother = RunsFile.GetValueF(CurKey, HPV_CIN2_allotherName);
CA1_CA1d = RunsFile.GetValueF(CurKey, CA1_CA1dName);
CA2_CA2d = RunsFile.GetValueF(CurKey, CA2_CA2dName);
CA3_CA3d = RunsFile.GetValueF(CurKey, CA3_CA3dName);
CA1_CA2 = RunsFile.GetValueF(CurKey, CA1_CA2Name);
CA2_CA3 = RunsFile.GetValueF(CurKey, CA2_CA3Name);
burnin.clear();
for(int i = 0; i < ModelStopAge; i++){
if(i < ModelStartAge){
burnin.push_back(0);
} else {
burnin.push_back (CohortSize*InitialPopulation[i][0]);
}
}
}
void Inputs::loadVariables() {
CIN2_NL = CINRegression[0][0];
for (int j = 0; j < 99; j ++){
pHPV_16[j] = HPVInc[j][0];
pHPV_18[j] = HPVInc[j][1];
pHPV_31[j] = HPVInc[j][2];
pHPV_33[j] = HPVInc[j][3];
pHPV_45[j] = HPVInc[j][4];
pHPV_52[j] = HPVInc[j][5];
pHPV_58[j] = HPVInc[j][6];
pHPV_otherHR[j] = HPVInc[j][7];
pHPV_LR[j] = HPVInc[j][8];
if(j < 20){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_17_19);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_17_19);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_17_19);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_17_19);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_17_19);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_17_19);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_17_19);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_17_19);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_17_19);
} else if (j <25){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_20_24);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_20_24);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_20_24);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_20_24);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_20_24);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_20_24);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_20_24);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_20_24);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_20_24);
} else if (j < 30){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_25_29);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_25_29);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_25_29);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_25_29);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_25_29);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_25_29);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_25_29);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_25_29);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_25_29);
} else if (j < 35){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_30_34);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_30_34);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_30_34);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_30_34);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_30_34);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_30_34);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_30_34);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_30_34);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_30_34);
} else if (j < 40){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_35_39);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_35_39);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_35_39);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_35_39);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_35_39);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_35_39);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_35_39);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_35_39);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_35_39);
} else if (j < 45){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_40_44);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_40_44);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_40_44);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_40_44);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_40_44);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_40_44);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_40_44);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_40_44);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_40_44);
} else if (j < 50){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_45_49);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_45_49);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_45_49);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_45_49);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_45_49);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_45_49);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_45_49);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_45_49);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_45_49);
} else if (j < 55){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_50_54);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_50_54);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_50_54);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_50_54);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_50_54);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_50_54);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_50_54);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_50_54);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_50_54);
} else if (j < 65){
pHPV_16[j] = ApplyMult (pHPV_16[j], NL_HPV16_55_65);
pHPV_18[j] = ApplyMult (pHPV_18[j], NL_HPV18_55_65);
pHPV_31[j] = ApplyMult (pHPV_31[j], NL_HPVhigh5_55_65);
pHPV_33[j] = ApplyMult (pHPV_33[j], NL_HPVhigh5_55_65);
pHPV_45[j] = ApplyMult (pHPV_45[j], NL_HPVhigh5_55_65);
pHPV_52[j] = ApplyMult (pHPV_52[j], NL_HPVhigh5_55_65);
pHPV_58[j] = ApplyMult (pHPV_58[j], NL_HPVhigh5_55_65);
pHPV_otherHR[j] = ApplyMult (pHPV_58[j], NL_HPVoHR_55_65);
pHPV_LR[j] = ApplyMult (pHPV_LR[j], NL_HPVLR_55_65);
}
if(j < 6){
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_1_5);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_1_5);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_1_5);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_1_5);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_1_5);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_1_5);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_1_5);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_1_5);
} else if (j < 11){
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_6_10);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_6_10);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_6_10);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_6_10);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_6_10);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_6_10);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_6_10);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_6_10);
} else if (j < 21){
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_11_20);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_11_20);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_11_20);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_11_20);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_11_20);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_11_20);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_11_20);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_11_20);
} else if (j < 31){
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_21_30);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_21_30);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_21_30);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_21_30);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_21_30);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_21_30);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_21_30);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_21_30);
} else if (j < 41){
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_31_40);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_31_40);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_31_40);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_31_40);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_31_40);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_31_40);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_31_40);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_31_40);
} else if (j < 51){
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_41_50);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_41_50);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_41_50);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_41_50);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_41_50);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_41_50);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_41_50);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_41_50);
} else {
pCIN3_CA1_oHR[j] = ApplyMult (CINProgression[j][0], CIN3_CA_otherHR_50);
pCIN3_CA1_16[j] = ApplyMult (CINProgression[j][1], CIN3_CA_16_50);
pCIN3_CA1_18[j] = ApplyMult (CINProgression[j][2], CIN3_CA_18_50);
pCIN3_CA1_31[j] = ApplyMult (CINProgression[j][3], CIN3_CA_high5_50);
pCIN3_CA1_33[j] = ApplyMult (CINProgression[j][4], CIN3_CA_high5_50);
pCIN3_CA1_45[j] = ApplyMult (CINProgression[j][5], CIN3_CA_high5_50);
pCIN3_CA1_52[j] = ApplyMult (CINProgression[j][6], CIN3_CA_high5_50);
pCIN3_CA1_58[j] = ApplyMult (CINProgression[j][7], CIN3_CA_high5_50);
}
if(j < 1){
pHPV_LR_NL[j] = ApplyMult(HPVClearance[j][0], HPV_NL_LR_1);
pHPV_otherHR_NL[j] = ApplyMult(HPVClearance[j][1], HPV_NL_otherHR_1);
pHPV_16_NL[j] = ApplyMult(HPVClearance[j][2], HPV_NL_16_1);
pHPV_18_NL[j] = ApplyMult(HPVClearance[j][3], HPV_NL_18_1);
pHPV_31_NL[j] = ApplyMult(HPVClearance[j][4], HPV_NL_high5_1);
pHPV_33_NL[j] = ApplyMult(HPVClearance[j][5], HPV_NL_high5_1);
pHPV_45_NL[j] = ApplyMult(HPVClearance[j][6], HPV_NL_high5_1);
pHPV_52_NL[j] = ApplyMult(HPVClearance[j][7], HPV_NL_high5_1);
pHPV_58_NL[j] = ApplyMult(HPVClearance[j][8], HPV_NL_high5_1);
pHPV_LR_CIN[j] = ApplyMult(HPVProgression[j][0], HPV_CIN_LR_1);
pHPV_otherHR_CIN[j] = ApplyMult(HPVProgression[j][1], HPV_CIN_otherHR_1);
pHPV_16_CIN[j] = ApplyMult(HPVProgression[j][2], HPV_CIN_16_1);
pHPV_18_CIN[j] = ApplyMult(HPVProgression[j][3], HPV_CIN_18_1);
pHPV_31_CIN[j] = ApplyMult(HPVProgression[j][4], HPV_CIN_high5_1);
pHPV_33_CIN[j] = ApplyMult(HPVProgression[j][5], HPV_CIN_high5_1);
pHPV_45_CIN[j] = ApplyMult(HPVProgression[j][6], HPV_CIN_high5_1);
pHPV_52_CIN[j] = ApplyMult(HPVProgression[j][7], HPV_CIN_high5_1);
pHPV_58_CIN[j] = ApplyMult(HPVProgression[j][8], HPV_CIN_high5_1);
pCIN2_NL_16[j] = ApplyMult (CIN2_NL, CIN2_NL_16_1);
pCIN3_NL_16[j] = ApplyMult (pCIN2_NL_16[j], CIN3_NL);
pCIN2_NL_18[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_1);
pCIN3_NL_18[j] = ApplyMult (pCIN2_NL_18[j], CIN3_NL);
pCIN2_NL_high5[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_1);
pCIN3_NL_high5[j] = ApplyMult (pCIN2_NL_high5[j], CIN3_NL);
pCIN2_NL_oHR[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_1);
pCIN3_NL_oHR[j] = ApplyMult (pCIN2_NL_oHR[j], CIN3_NL);
pCIN2_NL_LR[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_1);
pCIN3_NL_LR[j] = ApplyMult (pCIN3_NL_LR[j], CIN3_NL);
} else if (j < 5){
pHPV_LR_NL[j] = ApplyMult(HPVClearance[j][0], HPV_NL_LR_2_4);
pHPV_otherHR_NL[j] = ApplyMult(HPVClearance[j][1], HPV_NL_otherHR_2_4);
pHPV_16_NL[j] = ApplyMult(HPVClearance[j][2], HPV_NL_16_2_4);
pHPV_18_NL[j] = ApplyMult(HPVClearance[j][3], HPV_NL_18_2_4);
pHPV_31_NL[j] = ApplyMult(HPVClearance[j][4], HPV_NL_high5_2_4);
pHPV_33_NL[j] = ApplyMult(HPVClearance[j][5], HPV_NL_high5_2_4);
pHPV_45_NL[j] = ApplyMult(HPVClearance[j][6], HPV_NL_high5_2_4);
pHPV_52_NL[j] = ApplyMult(HPVClearance[j][7], HPV_NL_high5_2_4);
pHPV_58_NL[j] = ApplyMult(HPVClearance[j][8], HPV_NL_high5_2_4);
pHPV_LR_CIN[j] = ApplyMult(HPVProgression[j][0], HPV_CIN_LR_2_4);
pHPV_otherHR_CIN[j] = ApplyMult(HPVProgression[j][1], HPV_CIN_otherHR_2_4);
pHPV_16_CIN[j] = ApplyMult(HPVProgression[j][2], HPV_CIN_16_2_4);
pHPV_18_CIN[j] = ApplyMult(HPVProgression[j][3], HPV_CIN_18_2_4);
pHPV_31_CIN[j] = ApplyMult(HPVProgression[j][4], HPV_CIN_high5_2_4);
pHPV_33_CIN[j] = ApplyMult(HPVProgression[j][5], HPV_CIN_high5_2_4);
pHPV_45_CIN[j] = ApplyMult(HPVProgression[j][6], HPV_CIN_high5_2_4);
pHPV_52_CIN[j] = ApplyMult(HPVProgression[j][7], HPV_CIN_high5_2_4);
pHPV_58_CIN[j] = ApplyMult(HPVProgression[j][8], HPV_CIN_high5_2_4);
pCIN2_NL_16[j] = ApplyMult (CIN2_NL, CIN2_NL_16_2_4);
pCIN3_NL_16[j] = ApplyMult (pCIN2_NL_16[j], CIN3_NL);
pCIN2_NL_18[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_2_4);
pCIN3_NL_18[j] = ApplyMult (pCIN2_NL_18[j], CIN3_NL);
pCIN2_NL_high5[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_2_4);
pCIN3_NL_high5[j] = ApplyMult (pCIN2_NL_high5[j], CIN3_NL);
pCIN2_NL_oHR[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_2_4);
pCIN3_NL_oHR[j] = ApplyMult (pCIN2_NL_oHR[j], CIN3_NL);
pCIN2_NL_LR[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_2_4);
pCIN3_NL_LR[j] = ApplyMult (pCIN3_NL_LR[j], CIN3_NL);
} else {
pHPV_LR_NL[j] = ApplyMult(HPVClearance[j][0], HPV_NL_LR_5);
pHPV_otherHR_NL[j] = ApplyMult(HPVClearance[j][1], HPV_NL_otherHR_5);
pHPV_16_NL[j] = ApplyMult(HPVClearance[j][2], HPV_NL_16_5);
pHPV_18_NL[j] = ApplyMult(HPVClearance[j][3], HPV_NL_18_5);
pHPV_31_NL[j] = ApplyMult(HPVClearance[j][4], HPV_NL_high5_5);
pHPV_33_NL[j] = ApplyMult(HPVClearance[j][5], HPV_NL_high5_5);
pHPV_45_NL[j] = ApplyMult(HPVClearance[j][6], HPV_NL_high5_5);
pHPV_52_NL[j] = ApplyMult(HPVClearance[j][7], HPV_NL_high5_5);
pHPV_58_NL[j] = ApplyMult(HPVClearance[j][8], HPV_NL_high5_5);
pHPV_LR_CIN[j] = ApplyMult(HPVProgression[j][0], HPV_CIN_LR_5);
pHPV_otherHR_CIN[j] = ApplyMult(HPVProgression[j][1], HPV_CIN_otherHR_5);
pHPV_16_CIN[j] = ApplyMult(HPVProgression[j][2], HPV_CIN_16_5);
pHPV_18_CIN[j] = ApplyMult(HPVProgression[j][3], HPV_CIN_18_5);
pHPV_31_CIN[j] = ApplyMult(HPVProgression[j][4], HPV_CIN_high5_5);
pHPV_33_CIN[j] = ApplyMult(HPVProgression[j][5], HPV_CIN_high5_5);
pHPV_45_CIN[j] = ApplyMult(HPVProgression[j][6], HPV_CIN_high5_5);
pHPV_52_CIN[j] = ApplyMult(HPVProgression[j][7], HPV_CIN_high5_5);
pHPV_58_CIN[j] = ApplyMult(HPVProgression[j][8], HPV_CIN_high5_5);
pCIN2_NL_16[j] = ApplyMult (CIN2_NL, CIN2_NL_16_5);
pCIN3_NL_16[j] = ApplyMult (pCIN2_NL_16[j], CIN3_NL);
pCIN2_NL_18[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_5);
pCIN3_NL_18[j] = ApplyMult (pCIN2_NL_18[j], CIN3_NL);
pCIN2_NL_high5[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_5);
pCIN3_NL_high5[j] = ApplyMult (pCIN2_NL_high5[j], CIN3_NL);
pCIN2_NL_oHR[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_5);
pCIN3_NL_oHR[j] = ApplyMult (pCIN2_NL_oHR[j], CIN3_NL);
pCIN2_NL_LR[j] = ApplyMult (CIN2_NL, CIN2_NL_allother_5);
pCIN3_NL_LR[j] = ApplyMult (pCIN3_NL_LR[j], CIN3_NL);
}
pCIN2_CA1_oHR[j] = ApplyMult(pCIN3_CA1_oHR[j], CIN2_CA);
pCIN2_CA1_16[j] = ApplyMult (pCIN3_CA1_16[j], CIN2_CA);
pCIN2_CA1_18[j] = ApplyMult (pCIN3_CA1_18[j], CIN2_CA);
pCIN2_CA1_31[j] = ApplyMult(pCIN3_CA1_31[j], CIN2_CA);
pCIN2_CA1_33[j] = ApplyMult(pCIN3_CA1_33[j], CIN2_CA);
pCIN2_CA1_45[j] = ApplyMult(pCIN3_CA1_45[j], CIN2_CA);
pCIN2_CA1_52[j] = ApplyMult(pCIN3_CA1_52[j], CIN2_CA);
pCIN2_CA1_58[j] = ApplyMult(pCIN3_CA1_58[j], CIN2_CA);
mCA1[j] = CaMortality[j][0];
mCA2[j] = CaMortality[j][1];
mCA3[j] = CaMortality[j][2];
mCA1d[j] = CaMortality[j][3];
mCA2d[j] = CaMortality[j][4];
mCA3d[j] = CaMortality[j][5];
}
cytosens_NL = cytosens[1][0];
cytosens_CIN = cytosens[1][1];
cytosens_Ca = cytosens[1][3];
if(VaccineType == "Bivalent"){
vaccinetype = VxType::Bivalent;
VE_1618 = vaccineefficacy[0][0];
VE_high5 = vaccineefficacy[1][0];
cHPVVaccine = Costs[12][0];
} else if(VaccineType == "Nonavalent"){
vaccinetype = VxType::Nonavalent;
VE_1618 = vaccineefficacy[0][1];
VE_high5 = vaccineefficacy[1][1];
cHPVVaccine = Costs[13][0];
}
if(MechanismofImmunity == "Degree"){
ImmuneMechanism = Immunity::Degree;
} else if(MechanismofImmunity == "Factor"){
ImmuneMechanism = Immunity::Factor;
} else if(MechanismofImmunity == "None"){
ImmuneMechanism = Immunity::None;
}
cPtTime = Costs[0][0];
cPaptest = Costs[1][0];
cReturnForResult = Costs[2][0];
cColpoTime = Costs[3][0];
cColpoProc = Costs[4][0];
cCryoVisit = Costs[5][0];
cCryoHPV = Costs[6][0];
cCryoCIN23 = Costs[7][0];
cCryoCA = Costs[8][0];
cStage1Ca = Costs[9][0];
cStage2Ca = Costs[10][0];
cStage3Ca = Costs[11][0];
disabilityCA1 = Disability[0][0];
disabilityCA2 = Disability[1][0];
disabilityCA3 = Disability[2][0];
}
double Inputs::ApplyMult(double prob, double mult){
double rate;
rate = -log (1 - prob) * mult;
prob = 1 - exp(-rate);
return(prob);
}
void Inputs::loadCalibParams(vector<double> calib_params) {
CIN2_NL_allother_1 = calib_params[0];
CIN2_NL_allother_2_4 = calib_params[1];
CIN2_NL_allother_5 = calib_params[2];
CIN2_NL_16_1 = calib_params[3];
CIN2_NL_16_2_4 = calib_params[4];
CIN2_NL_16_5 = calib_params[5];
HPV_NL_LR_1 = calib_params[6];
HPV_NL_LR_2_4 = calib_params[7];
HPV_NL_LR_5 = calib_params[8];
HPV_NL_otherHR_1 = calib_params[9];
HPV_NL_otherHR_2_4 = calib_params[10];
HPV_NL_otherHR_5 = calib_params[11];