gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Identifier ITYPE recognized as an int in the arguments of an action #3627

Closed benoitgaudou closed 1 year ago

benoitgaudou commented 1 year ago

Describe the bug In the experimental plugin, irit.gama.switchproject, an attempt of event-based scheduling has been implemented. In particular, an action later has been implemented in order to postpone the execution of an action by an agent:

    @action(name = "later", args = {
            @arg(name = IKeywordIrit.THE_ACTION, type = IType.ID, optional = false, doc = @doc("The name of an action or a primitive")),
            @arg(name = IKeywordIrit.WITH_ARGUMENTS, type = IType.MAP, optional = true, doc = @doc("A map expression containing the parameters of the action")),
            @arg(name = IKeywordIrit.AT, type = IType.DATE, optional = true, doc = @doc("Call date")),
            @arg(name = IKeywordIrit.REFER_TO, type = IType.AGENT, optional = true, doc = @doc("The agent to refer")) }, doc = @doc(examples = {
                    @example("do later execute: my_action arguments: map((\"test\"::2)) date: starting_date") }, value = "Do action when the date is reached."))
    @SuppressWarnings("unchecked")
    public String register(final IScope scope) throws GamaRuntimeException {

In a previous GAMa version, it works. But now the facet (the_action) does not accept anymore an action id, as it is expecting an int value. The form is very similar to one of the statement do...

To Reproduce Steps to reproduce the behavior:

  1. load the plugin irit.gama.switchproject
  2. Look at one of the provided model.

Desktop (please complete the following information):

AlexisDrogoul commented 1 year ago

Do you know when this began (which commit) ? Or was it working with an even older version of GAMA ?

benoitgaudou commented 1 year ago

It worked 2 years ago (https://github.com/gama-platform/gama.experimental/blob/GAMA_1.9.0/irit.gama.switchproject/src/irit/gaml/skills/scheduling/SchedulingSkill.java)

But I do not know when it stopped to work.

lesquoyb commented 1 year ago

Hello @benoitgaudou is this issue fixed ?

AlexisDrogoul commented 1 year ago

I have tested it using a self-defined primitive/action and the fix is working well. Closing time ! @benoitgaudou do not hesitate to reopen of course :)