-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes.txt
More file actions
124 lines (109 loc) · 3.76 KB
/
notes.txt
File metadata and controls
124 lines (109 loc) · 3.76 KB
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
/*
* -------------------------------------------------------------------------------------------
* Utilities for connecting to mongo and getting examples. Fixes for locking below.
* -------------------------------------------------------------------------------------------
*
* Fix mongo connectivity issues:
*
* -- Manually remove the lockfile: sudo rm /var/lib/mongodb/mongod.lock
*
* -- Run the repair script: sudo -u mongodb mongod -f /etc/mongodb.conf --repair
*
* -- Start your MongoDB server with sudo start mongodb and verify it is running with sudo
*
* status mongodb and by trying to connect to it with mongo test.
*
* --------------------------------------------------------------------------------------------
*/
/*
* Check the code examples in the casbah sources!!
*
*
* ----------------------------------
* Some basic DB-related operations:
* ----------------------------------
*
* 1. Parse a video into a db: Utils.parseCaviar("/home/nkatz/dev/CAVIAR-abrupt/01-Walk1")
* 2. Parse all CAVIAR into dbs: caviartoMongo("/home/nkatz/dev/CAVIAR-abrupt")
* 3. Get all examples from a single video and write them to ASP: getAllExamples("CAVIAR-29-Fight_OneManDown3", "examples")
* 4. Get one example by time:
* val col = MongoClient()("CAVIAR-01-Walk1")("examples")
getOneExample("time", 37760, col)
5.
*/
/**
*
* Pattern matching with case classes.
*
/* Pattern match on the class */
def test(x: Expression) = {
x match {
case l: Literal => l.skolemize(_, _)
}
}
/* Pattern match on the class and its fields */
def test2(x: Expression) = {
x match {
case l @ Literal(x,y,z) => l.skolemize(_,_)
}
}
*/
Some (XHAIL)-learnt theories from the easy ones...
----------------------------------
Learnt from '01-Walk1':
----------------------------------
terminatedAt(moving(X2,X3),X1).
initiatedAt(meeting(X2,X3),X1) :-
orientFar(X3,X2,45,X1),
distLessThan(X2,X3,34,X1).
initiatedAt(moving(X1,X2),X3) :-
happensAt(walking(X1),X3),
happensAt(walking(X2),X3),
distLessThan(X1,X2,27,X3).
-----------------------------------
Learnt from '02-Walk2':
-----------------------------------
terminatedAt(meeting(X3,X2),X1) :-
distMoreThan(X2,X3,24,X1).
terminatedAt(moving(X3,X1),X2) :-
happensAt(active(X1),X2).
initiatedAt(meeting(X3,X1),X2) :-
happensAt(active(X3),X2),
happensAt(active(X1),X2).
initiatedAt(moving(X2,X3),X1) :-
happensAt(enters(X3),X1),
distLessThan(X3,X2,25,X1).
-----------------------------------
Learnt from 12-Rest_WiggleOnFloor:
-----------------------------------
terminatedAt(moving(X3,X2),X1).
initiatedAt(moving(X3,X2),X1) :-
happensAt(walking(X2),X1),
happensAt(walking(X3),X1).
---------------------------------
Learnt from 13-Rest_FallOnFloor:
---------------------------------
terminatedAt(meeting(X3,X2),X1).
initiatedAt(meeting(X2,X3),X1) :-
happensAt(active(X3),X1),
happensAt(active(X2),X1).
---------------------------------
Learnt from 25-Fight_RunAway1
---------------------------------
initiatedAt(fighting(X1,X2),X3) :-
happensAt(abrupt(X1),X3),
distLessThan(X1,X2,40,X3).
---------------------------------
Learnt from 26-Fight_RunAway2
---------------------------------
terminatedAt(fighting(X3,X1),X2).
initiatedAt(fighting(X3,X1),X2) :-
happensAt(abrupt(X1),X2),
holdsAt(visible(X3),X2).
---------------------------------
Learnt from 26-Fight_RunAway2
---------------------------------
terminatedAt(fighting(X3,X1),X2).
initiatedAt(fighting(X3,X1),X2) :-
happensAt(abrupt(X1),X2),
holdsAt(visible(X3),X2).