1
1
function main ( ) {
2
2
3
- const N_CLONES = 45 ** 2
3
+ const N_CLONES = 42 ** 2
4
4
const N_GEN = 50000
5
- const infect_rate = 0.0002
6
- const initial_infection_rate = 0.001
7
- const transmission_rate = 0.7
8
- const vaccine_transmission_rate = 0.01
9
- const vaccine_taking_rate = 0.00003
10
- const double_days = 4
11
- const infected_time = 10
12
- const post_time = 13
13
- const vaccine_shield_days = 360
14
- const D = 3
5
+ const infect_rate = 0.0001
6
+ const initial_infection_rate = 0.0001
7
+ const transmission_rate = 0.9
8
+ const vaccine_transmission_rate = 0.05
9
+ const vaccine_taking_rate = 0.0002
10
+ const double_days = 1
11
+ const infected_time = 4
12
+ const post_time = 30
13
+ const vaccine_shield_days = 100
14
+ const D = 1
15
15
const gridx = Math . round ( Math . sqrt ( N_CLONES ) ) * Math . round ( Math . sqrt ( N_CLONES ) ) == N_CLONES ?Math . round ( Math . sqrt ( N_CLONES ) ) : Math . round ( Math . sqrt ( N_CLONES ) ) + 1
16
16
const gridy = Math . round ( Math . sqrt ( N_CLONES ) ) * Math . round ( Math . sqrt ( N_CLONES ) ) == N_CLONES ?Math . round ( Math . sqrt ( N_CLONES ) ) : Math . round ( Math . sqrt ( N_CLONES ) ) + 1
17
17
@@ -31,11 +31,13 @@ function main(){
31
31
grid [ i ] . infected_time = 0
32
32
grid [ i ] . vaccine_days = 0
33
33
grid [ i ] . double_days = 0
34
+ grid [ i ] . is_double = false
34
35
} else {
35
36
grid [ i ] . type = "neutral"
36
37
grid [ i ] . infected_time = 0
37
38
grid [ i ] . vaccine_days = 0
38
39
grid [ i ] . double_days = 0
40
+ grid [ i ] . is_double = false
39
41
40
42
}
41
43
}
@@ -75,15 +77,20 @@ function main(){
75
77
if ( your_mate . type == "infected" && you . type == "neutral" && Math . random ( ) < transmission_rate ) {
76
78
you . type = "infected"
77
79
}
78
- // if (your_mate.type == "infected" && you.type=="infected"){
79
- // you.type = "double"
80
- // }
80
+
81
+ if ( your_mate . type == "infected" && you . type == "infected" ) {
82
+ you . is_double = true
83
+ }
81
84
// TODo
82
85
if ( you . type == "double" ) {
83
86
you . double_days ++
84
87
if ( you . double_days == double_days ) {
88
+ you . is_double = false
85
89
you . type = "unneutral"
86
90
you . double_days = 0
91
+ you . infected_time = 0
92
+ } else {
93
+ you . infected_time -= 1
87
94
}
88
95
}
89
96
if ( your_mate . type == "infected" && you . type == "vaccine" && Math . random ( ) < vaccine_transmission_rate ) {
@@ -136,7 +143,7 @@ function main(){
136
143
if ( el . type == "neutral" ) {
137
144
row . push ( "neutral" )
138
145
}
139
- if ( el . type == "infected" ) {
146
+ if ( el . type == "infected" && ! el . is_double ) {
140
147
row . push ( "infected" )
141
148
}
142
149
if ( el . type == "post" ) {
@@ -148,8 +155,9 @@ function main(){
148
155
if ( el . type == "vaccine" ) {
149
156
row . push ( "vaccine" )
150
157
}
151
- if ( el . type == "double " ) {
158
+ if ( el . is_double && el . type == "infected " ) {
152
159
row . push ( "double" )
160
+ console . log ( "dob" ) ;
153
161
}
154
162
155
163
}
0 commit comments