mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-07-05 17:11:35 +02:00
Documentation
This commit is contained in:

committed by
Steffen Illium

parent
604c0c6f57
commit
855f53b406
@ -3,7 +3,7 @@ from dataclasses import dataclass
|
||||
|
||||
from marl_factory_grid.environment.entity.object import Object
|
||||
|
||||
TYPE_VALUE = 'value'
|
||||
TYPE_VALUE = 'value'
|
||||
TYPE_REWARD = 'reward'
|
||||
TYPES = [TYPE_VALUE, TYPE_REWARD]
|
||||
|
||||
@ -11,10 +11,7 @@ TYPES = [TYPE_VALUE, TYPE_REWARD]
|
||||
@dataclass
|
||||
class InfoObject:
|
||||
"""
|
||||
TODO
|
||||
|
||||
|
||||
:return:
|
||||
Data class representing information about an entity or the global environment.
|
||||
"""
|
||||
identifier: str
|
||||
val_type: str
|
||||
@ -24,10 +21,14 @@ class InfoObject:
|
||||
@dataclass
|
||||
class Result:
|
||||
"""
|
||||
TODO
|
||||
A generic result class representing outcomes of operations or actions.
|
||||
|
||||
|
||||
:return:
|
||||
Attributes:
|
||||
- identifier: A unique identifier for the result.
|
||||
- validity: A boolean indicating whether the operation or action was successful.
|
||||
- reward: The reward associated with the result, if applicable.
|
||||
- value: The value associated with the result, if applicable.
|
||||
- entity: The entity associated with the result, if applicable.
|
||||
"""
|
||||
identifier: str
|
||||
validity: bool
|
||||
@ -36,6 +37,11 @@ class Result:
|
||||
entity: Object = None
|
||||
|
||||
def get_infos(self):
|
||||
"""
|
||||
Get information about the result.
|
||||
|
||||
:return: A list of InfoObject representing different types of information.
|
||||
"""
|
||||
n = self.entity.name if self.entity is not None else "Global"
|
||||
# Return multiple Info Dicts
|
||||
return [InfoObject(identifier=f'{n}_{self.identifier}',
|
||||
@ -50,32 +56,30 @@ class Result:
|
||||
return f'{self.__class__.__name__}({self.identifier.capitalize()} {valid}valid{reward}{value}{entity})'
|
||||
|
||||
|
||||
@dataclass
|
||||
class TickResult(Result):
|
||||
"""
|
||||
TODO
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class ActionResult(Result):
|
||||
"""
|
||||
TODO
|
||||
A specific Result class representing outcomes of actions.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class ActionResult(Result):
|
||||
pass
|
||||
|
||||
@dataclass
|
||||
class State(Result):
|
||||
# TODO: change identifiert to action/last_action
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class DoneResult(Result):
|
||||
"""
|
||||
A specific Result class representing the completion of an action or operation.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclass
|
||||
class State(Result):
|
||||
# TODO: change identifier to action/last_action
|
||||
pass
|
||||
|
||||
@dataclass
|
||||
class TickResult(Result):
|
||||
"""
|
||||
A specific Result class representing outcomes of tick operations.
|
||||
"""
|
||||
pass
|
||||
|
Reference in New Issue
Block a user