OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-rocca commits / d985a92

Updated to include descriptions of collect_diamonds example
d985a92b77f92c5a1984fefd377920d5cc40fa7e
by Hedra <tanksh24@gmail.com> · 2022-07-01T20:57:36.000Z

Changed files (1) +133 -8

examples/README.md +133 -8
……@@ -189,14 +189,139 @@ Unmaintained. As a close alternative, see the jupyter notebook file
189189
190190### Usage
191191
1921. Compile malmo https://github.com/Microsoft/malmo, see
193 https://github.com/microsoft/malmo/blob/master/doc/build_linux.md
1921. Clone malmo https://github.com/Microsoft/malmo
193 Note: No need to compile malmo as a pre-built version (MalmoPython) has been included
194 under `../rocca/malmo`. Only install the required dependencies to launch minecraft.
194195
1952. After compiling, copy
196 `<MALMO>/build/install/Python_Examples/MalmoPython.so` and
197 `<MALMO>/build/install/Python_Examples/malmoutils.py` under
198 `<ROCCA>/examples/malmo`.
1962. Launch `<MALMO>/Minecraft/launchClient.sh`.
199197
2003. Launch `<MALMO>/Minecraft/launchClient.sh`.
1983. Launch chase malmo `python chase_malmo.py`.
201199
2024. Launch chase malmo `python chase_malmo.py`.
200
201## Collect diamonds
202
203### Description
204
205A simple minecraft environment which includes blocks of diamonds locked
206inside a house and a key to the house. The agent must look for
207the key, open the house and collect a diamond to get a reward.
208
209### Status
210
211The Rocca agent is able to learn and plan the desired cognitive schematics
212leading to getting/accumulating a reward via pattern mining and temporal deduction.
213
214The three optimal action plans required to get a reward are:
215
2161. `outside(self, house) ∧ do(go_to_key) ↝ hold(self, key)`
217
218```scheme
219(BackPredictiveImplicationScopeLink (stv 1 0.0111248)
220 (VariableSet
221 ) ; [80075fffffff523a][1]
222 (SLink
223 (ZLink
224 ) ; [800fbffffffe8ce4][1]
225 ) ; [da5f815ba9d4009f][1]
226 (AndLink
227 (EvaluationLink (stv 0.64 0.0588235)
228 (PredicateNode "outside") ; [72730412e28a734][1]
229 (ListLink
230 (ConceptNode "self") ; [40b11d11524bd751][1]
231 (ConceptNode "house") ; [63eb9919f37daa5f][1]
232 ) ; [aadca36fe9d1a468][1]
233 ) ; [ca0c329fb1ab493b][1]
234 (ExecutionLink
235 (SchemaNode "go_to_key") ; [7f46c329a5e57604][1]
236 ) ; [f8086e6fdf73cdf4][1]
237 ) ; [ddda31153cf2aa6d][1]
238 (EvaluationLink (stv 0.32 0.0588235)
239 (PredicateNode "hold") ; [4b1b7a8b0a4d2853][1]
240 (ListLink
241 (ConceptNode "self") ; [40b11d11524bd751][1]
242 (ConceptNode "key") ; [4d0844146f96d3][1]
243 ) ; [e7a9c95ae7484b28][1]
244 ) ; [e6a8f21e6b37d8f0][1]
245) ; [ff069058911f0233][1]
246```
2472. `outside(self, house) ∧ hold(self, key) ∧ do(go_to_house) ↝ inside(self, house)`
248
249```scheme
250(BackPredictiveImplicationScopeLink (stv 1 0.00621118)
251 (VariableSet
252 ) ; [80075fffffff523a][1]
253 (SLink
254 (ZLink
255 ) ; [800fbffffffe8ce4][1]
256 ) ; [da5f815ba9d4009f][1]
257 (AndLink
258 (ExecutionLink
259 (SchemaNode "go_to_house") ; [7e1737e3e117d059][1]
260 ) ; [93427319ec122fff][1]
261 (EvaluationLink (stv 0.64 0.0588235)
262 (PredicateNode "outside") ; [72730412e28a734][1]
263 (ListLink
264 (ConceptNode "self") ; [40b11d11524bd751][1]
265 (ConceptNode "house") ; [63eb9919f37daa5f][1]
266 ) ; [aadca36fe9d1a468][1]
267 ) ; [ca0c329fb1ab493b][1]
268 (EvaluationLink (stv 0.32 0.0588235)
269 (PredicateNode "hold") ; [4b1b7a8b0a4d2853][1]
270 (ListLink
271 (ConceptNode "self") ; [40b11d11524bd751][1]
272 (ConceptNode "key") ; [4d0844146f96d3][1]
273 ) ; [e7a9c95ae7484b28][1]
274 ) ; [e6a8f21e6b37d8f0][1]
275 ) ; [fbf4892ec0643e2c][1]
276 (EvaluationLink
277 (PredicateNode "inside") ; [63398dcfcf85c8a3][1]
278 (ListLink
279 (ConceptNode "self") ; [40b11d11524bd751][1]
280 (ConceptNode "house") ; [63eb9919f37daa5f][1]
281 ) ; [aadca36fe9d1a468][1]
282 ) ; [871c182b52e89756][1]
283) ; [a2984b519c1ddc4f][1]
284```
285
2863. `inside(self, house) ∧ do(go_to_diamonds) ↝ Reward(1)`
287
288```scheme
289(BackPredictiveImplicationScopeLink (stv 1 0.00621118)
290 (VariableSet
291 ) ; [80075fffffff523a][1]
292 (SLink
293 (ZLink
294 ) ; [800fbffffffe8ce4][1]
295 ) ; [da5f815ba9d4009f][1]
296 (AndLink
297 (EvaluationLink
298 (PredicateNode "inside") ; [63398dcfcf85c8a3][1]
299 (ListLink
300 (ConceptNode "self") ; [40b11d11524bd751][1]
301 (ConceptNode "house") ; [63eb9919f37daa5f][1]
302 ) ; [aadca36fe9d1a468][1]
303 ) ; [871c182b52e89756][1]
304 (ExecutionLink
305 (SchemaNode "go_to_diamonds") ; [7aee74cf6bad6442][1]
306 ) ; [a2630f96ffbe0861][1]
307 ) ; [b4373ec3773f1783][1]
308 (EvaluationLink
309 (PredicateNode "Reward") ; [155bb4d713db0d51][1]
310 (NumberNode "1") ; [2cf0956d543cff8e][1]
311 ) ; [d3cee8bdda06ffcb][1]
312) ; [8a298365b46b204b][1]
313```
314
315### Usage
316
3171. Clone malmo https://github.com/Microsoft/malmo
318 Note: No need to compile malmo as a pre-built version (MalmoPython) has been included
319 under `../rocca/malmo`. Only install the required dependencies to launch minecraft.
320
3212. Launch `<MALMO>/Minecraft/launchClient.sh`.
322
3233. Launch collect diamonds `python collect_diamonds.py`.
324 Note: If there is a need to visualize mined cognitive schematics, do the following before step 3.
325 a. Build and run atompace-explorer here https://github.com/tanksha/atomspace-explorer rocca_demo branch.
326 b. Start the RESTAPI `python start_rest_service.py`
327 c. Open `collect_diamonds.py` and set `self.visualize_cogscm = True`