Module pearl.api.action_result

Expand source code
from dataclasses import dataclass
from typing import Any, Dict, Optional

from pearl.api.action_space import ActionSpace

from pearl.api.observation import Observation

from pearl.api.reward import Reward


@dataclass
class ActionResult:
    observation: Observation
    reward: Reward
    terminated: bool
    truncated: bool
    info: Optional[Dict[str, Any]] = None
    cost: Optional[float] = None
    available_action_space: Optional[ActionSpace] = None

    @property
    def done(self) -> bool:
        return self.terminated or self.truncated

Classes

class ActionResult (observation: object, reward: object, terminated: bool, truncated: bool, info: Optional[Dict[str, Any]] = None, cost: Optional[float] = None, available_action_space: Optional[ActionSpace] = None)

ActionResult(observation: object, reward: object, terminated: bool, truncated: bool, info: Optional[Dict[str, Any]] = None, cost: Optional[float] = None, available_action_space: Optional[pearl.api.action_space.ActionSpace] = None)

Expand source code
@dataclass
class ActionResult:
    observation: Observation
    reward: Reward
    terminated: bool
    truncated: bool
    info: Optional[Dict[str, Any]] = None
    cost: Optional[float] = None
    available_action_space: Optional[ActionSpace] = None

    @property
    def done(self) -> bool:
        return self.terminated or self.truncated

Class variables

var available_action_space : Optional[ActionSpace]
var cost : Optional[float]
var info : Optional[Dict[str, Any]]
var observation : object
var reward : object
var terminated : bool
var truncated : bool

Instance variables

var done : bool
Expand source code
@property
def done(self) -> bool:
    return self.terminated or self.truncated