specless.wrapper.tswrapper

SpeclessEnv

A standard gym.Env is accepted if the states and actions are finite (Discrete Obs and Action Space) >>> import gymnasium as gym >>> from specless.minigrid.tspenv import TSPEnv # NOQA >>> env = gym.make(“MiniGrid-TSP-v0”)

# >>> env.obs_space # Dict(Discrete(), Text())

Wrapper

A standard gym environment with other spaces (e.g., Dict) can be translated into a SpeclessEnv by providing the

# TODO: >>> # >>> from specless.minigrid.core import SpeclessWwrapper # >>> env = SpeclessWwrapper(env, states, actions)

Note, continuous space will be supported in the future (using Sampled-based planners to translate the env into a finite system.)

If wanted, we can extend it to multiple agents # TODO: >>> # >>> from specless.minigrid.core import MultiAgentWrapper # >>> initial_states = [(1, 1), (2, 2), (3, 3)] # >>> env = MultiAgentWrapper(env, initial_states, concurrent=False) # Turn-based

Transition System Builder

>>> import numpy as np
>>> import specless as sl
>>> from specless.automaton.transition_system import TSBuilder
>>> env = gym.make("MiniGrid-TSP-v0")
>>> env = sl.MiniGridTransitionSystemWrapper(env, ignore_direction=True)
>>> tsbuilder = TSBuilder()
>>> ts = tsbuilder(env)

For multiple agents >>> env = gym.make(“MiniGrid-TSP-v0”) >>> env = sl.MiniGridTransitionSystemWrapper(env, ignore_direction=True) >>> initial_states = [(1, 1), (2, 2), (3, 3)]

#TODO: >>> env = MultiAgentWrapper(env, initial_states, concurrent=True)

>>> tsbuilder = TSBuilder()
>>> ts = tsbuilder(env)

Classes

TransitionSystemWrapper

Wrapper to define an environment that can be represented as a transition system.