Skip to content

luigiquara/PING

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PING

Prolog In the NetHack Game

PING defines a Prolog knowledge base for a simple enviroment defined in MiniHack.

The room is a 10x10 grid, with an enemy, a weapon, a trap and an apple. The task is to pick up the apple and eat it.

It uses the PySwip package to integrate the Prolog KB and ask queries in Python scripts.

Installation

This application requires MiniHack for the environment definition; it can be easily installed via pypi:

$ pip install minihack

For the reasoning process, it needs SWI-Prolog and PySwip.

Trying it out

$ python main.py -h
usage: main.py [-h] [--width WIDTH] [--height HEIGHT] [--monster MONSTER] [--weapon WEAPON]
               [--trap TRAP] [--path_to_kb PATH_TO_KB] [--num_episodes NUM_EPISODES]
               [--max_steps MAX_STEPS] [--logging] [--fast_mode] [--save_gif] [--gif_path GIF_PATH]
               [--gif-duration GIF_DURATION]

optional arguments:
  -h, --help            show this help message and exit
  --width WIDTH         The width of the environment
  --height HEIGHT       The height of the environment
  --monster MONSTER     The type of monster present in the environment
  --weapon WEAPON       The weapon present in the environment
  --trap TRAP           The type of trap present in the environment
  --path_to_kb PATH_TO_KB
                        The path to the Prolog knowledge base
  --num_episodes NUM_EPISODES
                        The number of episodes to perform
  --max_steps MAX_STEPS
                        The maximum number of steps per episode
  --logging             Save the assertion made in Prolog
  --fast_mode           Print only summary information
  --save_gif            Save the episodes as gifs
  --gif_path GIF_PATH   Where to save the GIF of the episodes
  --gif-duration GIF_DURATION
                        The duration of each GIF image

About

Prolog In the NetHack Game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published