glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Hello all


From: Kai Antweiler
Subject: Re: [glob2-devel] Hello all
Date: Mon, 21 Jul 2008 09:04:27 +0200

> So does the algorithm for the resource pickup make the worker pick up
> the resource that has the lowest distance value from it when it was first
> allocated the task?

In each step the worker chooses his next field. So if a new resource
is available nearer or the old one vanishes he will automatically walk
to a different resource.
(By the way the resource values are only recalculated every fifth time
step or so. But this can only lead to one maybe or two steps in the
wrong direction.)


> If that's the case maybe a possible optimisation is to
> make it consider the resources that are close to the target building as
> well?

Yes, we thought about it. But because we don't know the target
resource, this is not so easy. We're not even using heuristics here.
So this is clearly an issue where we can improve.


> And a further optimisation is to make it find the nearest resource
> located along the path to the target, but that might be quite a heavy
> process...

Actually I think this is easier - and a good idea.

I thought a while ago about having a worker choose his next
field by the distance values as usual, but have him choose from
all fields with the same distance a field that is closest the building.

After reading your comment, I think we should use both distances equally:

If the glob has not been at (or maybe near the building) he
should look at those fields that are nearer to the resource.

Than at those that are nearer to the building.

If there is a one that qualifies for both, take it.

If not, look at the field with the lowest distances value.
And here I mean: comparing the resource distances to the
building distances.

If that value is an improvement to the current field, take it.

Otherwise take the other field.


Although this algorithm might take longer in many cases, I think
it will be better on average. Especially if this behavior is considered
in unit allocation.

-- 
Kai Antweiler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]