how to combine a go_to-movement with a heading / a move-movement with a target

60 views
Skip to first unread message

scs.s...@gmail.com

unread,
Feb 6, 2019, 12:50:47 AM2/6/19
to GAMA
Hi all,

I do have a question regarding the moving-skill possibilities:

I want my agent to move over the grid, and whilst doing so, update the movement with a different heading (using an equation and data from the current cell of the grid).

If I get it right, this would only work with a "move"-statement. But: it has to move towards a target, which is only given in the "goto"-statement. Is there any way of either give a target to a move-movement or a change the heading of a go-to-movement?

Thanks,
Sheba

Patrick Taillandier

unread,
Feb 6, 2019, 2:48:54 AM2/6/19
to gama-p...@googlegroups.com
Hi,

I am not sure to understand: either you move toward a target (using the goto statement), either in a direction given by an equation (using the move statement), you cannot do both at the same time. Except if you want that your agent sometimes move in a direction of a target and sometimes :

reflex move {
      if (every(10 #cycle) {
           do move heading: computed_heading;
      } else {
           do goto target: my_target;
      }
}

Cheers,

Patrick

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at https://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

scs.s...@gmail.com

unread,
Feb 6, 2019, 3:19:21 PM2/6/19
to GAMA
Hi Patrick,

well actually that's exactly the problem:

I would like my agent to move in a direction, but with a target in mind - so: he wants to reach a certain target, but is influenced by the streams and currents direction/speed.

That way, the agent has to react on environmental conditions he encounters at each cell in a way (e.g. if the direction of a current is exactly the opposite of the agent's, the speed has to be reduced or, if the direction of a current is about 45 degrees from the heading of the agent, but stronger than the speed of the agent, it has to influence the agents heading or the engery the agent needs goes up etc...).

What I would like to do is a "real life" situation of a navigator, who does not move over a known grid, like optimal path/weights (which would include an omniscient person), but reacts directly to the conditions he findes on the way.

Best, Sheba

Srirama Bhamidipati

unread,
Feb 6, 2019, 3:24:56 PM2/6/19
to GAMA
Hi

As Patrick has suggested, you can do any math/ physics to get a value for computed_heading and the agent will move in that direction. To do this, you must detect the underlying grid cell and its attributes to calculate its influence on the agent's movement.

Cheers,
Srirama

Patrick Taillandier

unread,
Feb 7, 2019, 2:41:47 AM2/7/19
to gama-p...@googlegroups.com
Hi,

A solution is maybe to use the possibility to give weights to cells when using the goto (you can change the weight of the cell at every step if you want....). You have an example in the model library: Features/Agent Movement/Goto Grid Weights.gaml

Cheers,

Patrick

--

scs.s...@gmail.com

unread,
Feb 7, 2019, 11:29:09 AM2/7/19
to GAMA
Hi, yes thanks - I've seen the grid weights, but thats actually not really what I would like to do, it's more like least cost path, and would like to exactly move away from that. Sadly enought that means, I can't really do what I wanted to do, but what can one do... Thanks, anyway :)

Patrick Taillandier

unread,
Feb 7, 2019, 11:32:50 AM2/7/19
to gama-p...@googlegroups.com
Hi,

Another solution is to use the build the theoretical path to the target (using the path_between operator), then to use it to compute the next destination toward if there was no other constraint, then to modify this point according to your constraint (wind and so one).....

Le jeu. 7 févr. 2019 à 17:29, <scs.s...@gmail.com> a écrit :
Hi, yes thanks - I've seen the grid weights, but thats actually not really what I would like to do, it's more like least cost path, and would like to exactly move away from that. Sadly enought that means, I can't really do what I wanted to do, but what can one do... Thanks, anyway :)

scs.s...@gmail.com

unread,
Feb 10, 2019, 10:33:12 AM2/10/19
to GAMA
hmmm, thanks, I'll have a look at that :)
Reply all
Reply to author
Forward
0 new messages