Skip to content

Commit

Permalink
rename chat to mutate_tree
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed Aug 14, 2024
1 parent 7fdc64b commit 307f3cd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 274 deletions.
195 changes: 0 additions & 195 deletions src/social_norms_trees/chat.py

This file was deleted.

49 changes: 0 additions & 49 deletions src/social_norms_trees/intworld_chat.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
"""Example of using worlds with just an integer for the state of the world"""

import warnings
from dataclasses import dataclass, field, replace
from functools import partial, wraps
from itertools import islice
from typing import TypeVar, Optional, List

import click
import py_trees

from social_norms_trees.chat import (
World,
update_behavior,
main,
)

from pprint import pformat


@dataclass
class BehaviorTreeWorld(World):
tree: py_trees.behaviour.Behaviour = field(
default_factory=py_trees.behaviours.Dummy
)


def print_world(world: BehaviorTreeWorld):
tree_display = py_trees.display.unicode_tree(world.tree)
print(f"{pformat(world)}\n\ntree:\n{tree_display}")


T = TypeVar("T", bound=py_trees.behaviour.Behaviour)

Expand Down Expand Up @@ -421,7 +400,6 @@ def exchange_nodes(

if __name__ == "__main__":

# main(world_)
tree = py_trees.composites.Sequence(
"",
False,
Expand Down Expand Up @@ -453,13 +431,5 @@ def exchange_nodes(
move_node(tree)
exchange_nodes(tree)
remove_node(tree)

print(format_tree_with_indices(tree))

pass

world_ = BehaviorTreeWorld(
behavior=[print_world, update_behavior, add_child],
available_behaviors=[print_world, add_child],
)
print_world(world_)

0 comments on commit 307f3cd

Please sign in to comment.