python-agentspeak icon indicating copy to clipboard operation
python-agentspeak copied to clipboard

Adding terms, goals, beliefs and etc...

Open joao-b-rosario opened this issue 3 years ago • 2 comments

I'm writing code with your implementation and as it stands I have some questions about how everything works.

I want to add path1(list) to the agent.

How can I do it?

Screenshot from 2022-12-22 15-59-57

joao-b-rosario avatar Dec 22 '22 16:12 joao-b-rosario

The idea is to be able to call the term on the agent code

image

Also, how can I add a plan or any other thing?

joao-b-rosario avatar Dec 22 '22 16:12 joao-b-rosario

Hi, happy new year!

Here's an example that triggers a plan in the agent from Python: https://github.com/niklasf/python-agentspeak/blob/master/examples/calling-asl/calling-asl.py

Adding a belief is almost the same:

agent.call(
    agentspeak.Trigger.addition,
    agentspeak.GoalType.belief,
    agentspeak.Literal("example", (1, 2)),
    agentspeak.runtime.Intention())

Doing so makes sense for events generated by the envrionment.

If the agent is wants to calculate something using a Python function, something like https://github.com/niklasf/python-agentspeak/blob/1b7f6eb6f34430de193466e0c3c6eebb251bac3f/examples/embedded/embedded.py#L12-L14C2 can be used to register it and return the result via unification.

niklasf avatar Jan 01 '23 12:01 niklasf