-
Notifications
You must be signed in to change notification settings - Fork 0
/
gather_sim_data.py
52 lines (46 loc) · 1.46 KB
/
gather_sim_data.py
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
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 20 00:15:51 2015
@author: James
"""
import csv
new_file = open("4pt_worker.csv","wb")
writer = csv.writer(new_file)
headers = ["WorkerID","Entry_date","Ability","Reputation","Like_list_len","Block_list_len","ratings","mid_thres","low_thre","quality","Tasks"]
writer.writerow(headers)
ID = 0
for work in workers:
new_row = []
new_row.append(ID)
new_row.append(work.entry_date)
new_row.append(work.ability)
new_row.append(work.reputation)
new_row.append(len(work.like_list))
new_row.append(len(work.block_list))
new_row.append(len(work.ratings))
new_row.append(work.mid_threshold)
new_row.append(work.low_threshold)
new_row.append(work.quality)
new_row.append(work.tasks_finished)
writer.writerow(new_row)
ID += 1
new_file.close()
new_file = open("4pt_requestors.csv","wb")
writer = csv.writer(new_file)
headers = ["RequestorID","Entry_date","Behavior","Reputation","Like_list_len","Block_list_len","ratings","mid_thres","low_thre"]
writer.writerow(headers)
ID = 1
for req in requestors:
new_row = []
new_row.append(ID)
new_row.append(req.entry_date)
new_row.append(req.behavior)
new_row.append(req.reputation)
new_row.append(len(req.like_list))
new_row.append(len(req.block_list))
new_row.append(len(req.ratings))
new_row.append(req.mid_threshold)
new_row.append(req.low_threshold)
writer.writerow(new_row)
ID += 1
new_file.close()