You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently atleast two MATRX worlds needed to add new objects to the world while the world is running. Currently the workaround is a custom action, though since the increasing commonality I propose to add it to MATRX.
Describe the solution you would like
An AddObject action, such as the one proposed in #286.
It use could be something like (inside the AgentBrain.decide_on_action method):
obj_to_add: An object inheriting from EnvObject, including any custom object.
add_range: The range in which this agent can add objects (in the above example 5 means that the agent can only add objects that are within a Euclidean distance of 5 its location). Results in a failed action when the location of the object is out of range. This follows a similar behaviour as the other object actions such as GrabObject and RemoveObject.
duration_in_ticks: Similar as always. It is the number of ticks the agent will be busy with doing this action. In the above example the value of 1 means that it will be busy adding this object for this and next tick.
Describe alternatives you have considered
A common solution now is to create your own action. Another option is to build in the (long planned) Event System that could handle this. However the former is not applicable anymore as more people need it and the latter should not be misused for this (and works with Action anyway).
Yes the example for adding object looks fine. Within that action we should also do the checks for valid placement etc. Also, I would make the add_range optional and have it set to infinity by default.
I would suggest also giving the user the ability to add an agent on the fly if possible. This requires some extra or other checks, so a different action named AddAgent maybe?
Is your feature request related to a problem? Please describe.
Currently atleast two MATRX worlds needed to add new objects to the world while the world is running. Currently the workaround is a custom action, though since the increasing commonality I propose to add it to MATRX.
Describe the solution you would like
An
AddObject
action, such as the one proposed in #286.It use could be something like (inside the
AgentBrain.decide_on_action
method):Where the action arguments behave as follows:
obj_to_add
: An object inheriting fromEnvObject
, including any custom object.add_range
: The range in which this agent can add objects (in the above example 5 means that the agent can only add objects that are within a Euclidean distance of 5 its location). Results in a failed action when the location of the object is out of range. This follows a similar behaviour as the other object actions such asGrabObject
andRemoveObject
.duration_in_ticks
: Similar as always. It is the number of ticks the agent will be busy with doing this action. In the above example the value of 1 means that it will be busy adding this object for this and next tick.Describe alternatives you have considered
A common solution now is to create your own action. Another option is to build in the (long planned) Event System that could handle this. However the former is not applicable anymore as more people need it and the latter should not be misused for this (and works with
Action
anyway).Additional context
A response to issue #286
The text was updated successfully, but these errors were encountered: