aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorÉtienne Simon <esimon@esimon.eu>2015-06-22 14:40:19 -0400
committerÉtienne Simon <esimon@esimon.eu>2015-06-22 14:40:19 -0400
commitbd08e452093bba68fe2d79b1e9da76488b203720 (patch)
tree48d82d8cf883ad642c483e2cad5cc707dd8c4694 /data
parentad5a03c6f60e5b2d543326bf8917b48e5b390b82 (diff)
downloadtaxi-bd08e452093bba68fe2d79b1e9da76488b203720.tar.gz
taxi-bd08e452093bba68fe2d79b1e9da76488b203720.zip
Update memory network
Diffstat (limited to 'data')
-rw-r--r--data/cut.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/data/cut.py b/data/cut.py
index fc0b3f9..6e1e4e5 100644
--- a/data/cut.py
+++ b/data/cut.py
@@ -11,14 +11,15 @@ last_time = 1404172787
class TaxiTimeCutScheme(IterationScheme):
- def __init__(self, dbfile=None, use_cuts=None):
+ def __init__(self, num_cuts=100, dbfile=None, use_cuts=None):
+ self.num_cuts = num_cuts
self.dbfile = os.path.join(data.path, 'time_index.db') if dbfile == None else dbfile
self.use_cuts = use_cuts
def get_request_iterator(self):
cuts = self.use_cuts
if cuts == None:
- cuts = [random.randrange(first_time, last_time) for _ in range(100)]
+ cuts = [random.randrange(first_time, last_time) for _ in range(self.num_cuts)]
l = []
with sqlite3.connect(self.dbfile) as db: