fetchai / agents-tac

Competition and Agent Frameworks for the Trading Agents Competition
https://fetchai.github.io/agents-tac
Apache License 2.0
27 stars 8 forks source link

add 'update' method in main loop for generic internal operations. #326

Closed marcofavorito closed 5 years ago

marcofavorito commented 5 years ago

Proposed changes

The PR proposes a new abstract method in the Agent class, the update() method. This method is called at every iteration of the main loop of the agent (that is, the one in the method run_main_loop()). The purpose of the update() method is to handle generic operations to update the state of the agent.

Notice how it differs from the act() method, that handles the outputs of the agent, and the react() method, that handles the inputs of the agent. Moreover, it's worth noticing that, at the moment, this is just a logical separation of operations, rather than an increase in expressiveness. There's no practical difference between the react and the update method.

Fixes

This PR is somehow related to #295. That's because some operations that we used to accomplish by allocating threads now can be completed inside this method.

Among other changes, the PR brings also small fixes to the source code.

Types of changes

What types of changes does your code introduce to agents-tac? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply.

Further comments

DavidMinarsch commented 5 years ago

I agree with your comment on the TaskQueue, something we should keep in mind for future architecture changes.