File tree 2 files changed +46
-3
lines changed
2 files changed +46
-3
lines changed Original file line number Diff line number Diff line change
1
+ language : python
2
+
3
+ cache :
4
+ pip : true
5
+ directories :
6
+ - $HOME/Library/Caches/Homebrew
7
+
8
+ matrix :
9
+ include :
10
+ - os : linux
11
+ dist : trusty
12
+ python : " 3.5"
13
+ - os : linux
14
+ dist : trusty
15
+ python : " 3.6"
16
+ - os : osx
17
+ osx_image : xcode8.3
18
+ sudo : required
19
+ language : generic
20
+ before_install :
21
+ # Travis bug: manually install python on osx
22
+ # See https://github.com/travis-ci/travis-ci/issues/2312#issuecomment-289140791
23
+ - brew update
24
+ - brew install python3
25
+ - virtualenv env -p python3
26
+ - source env/bin/activate
27
+
28
+ install :
29
+ - pip install -r requirements.txt
30
+
31
+ script :
32
+ - python start.py --travis
Original file line number Diff line number Diff line change 11
11
from collections import defaultdict
12
12
13
13
import math
14
+ import argparse
14
15
#import pdb
15
16
16
17
simulation_parameters = {'name' : 'name' ,
21
22
'start_cash_customer' : 100000.0 }
22
23
23
24
#@gui(simulation_parameters)
24
- def main (simulation_parameters ):
25
+ def main (simulation_parameters , isTravis ):
25
26
simulation = Simulation (rounds = simulation_parameters ['scheduledEndTime' ], processes = 1 )
26
27
27
28
insurancefirms = simulation .build_agents (InsuranceFirm , 'insurancefirm' ,
@@ -55,7 +56,17 @@ def main(simulation_parameters):
55
56
allagents .do ('filobl' )
56
57
insurancecustomers .do ('check_risk' )
57
58
58
- simulation .graphs ()
59
+ if not isTravis :
60
+ simulation .graphs ()
61
+
59
62
60
63
if __name__ == '__main__' :
61
- main (simulation_parameters )
64
+ # <Travis-specific code>
65
+ parser = argparse .ArgumentParser ()
66
+ parser .add_argument ('--travis' , dest = 'travis' , action = 'store_true' ,
67
+ default = False ,
68
+ help = 'Flag to disable gui when run in a Travis environment' )
69
+ args = parser .parse_args ()
70
+ # </Travis-specific code>
71
+
72
+ main (simulation_parameters , args .travis )
You can’t perform that action at this time.
0 commit comments