Coverage for navipy/__init__.py : 79%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Every agent comes with a brain processing the about of \ senses or sensors for biological or technical agent, respectively.
The senses of agents in navipy are limited to:
* 4d vision (brighness + depth)
The 4d vision sense is controlled by rendering module, either an \ online rendering or loaded from a database containing pre-rendered images.
For example to use pre-rendered images from a database:
.. literalinclude:: example/processing/apcv.py :lines: 10-11
Then the brain can be updated at a new position orientation:
.. literalinclude:: example/processing/apcv.py :lines: 15
Building your own brain -----------------------
The Brain class is an abstract Brain, such that it can not control an agent. \ To control, an agent, the Brain should have a function called velocity.
For example, an stationary agent should always return a null velocity.
.. literalinclude:: example/brain/static_brain.py :lines: 3,9-17
An agent using an average skyline homing vector, could be build as follow
.. literalinclude:: example/brain/asv_brain.py :lines: 4-5,11-36
"""
renderer=None): viewing_directions=None, channels=None)
raise NotImplementedError("Subclasses should implement this")
def posorients(self): else: raise NotImplementedError("Subclasses should implement this, " + "when renderer is not DataBaseLoad")
# create a file handler handler = logging.FileHandler(filename) handler.setLevel(level) # create a logging format formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') handler.setFormatter(formatter) # add the handlers to the logger logger.addHandler(handler)
|