Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)
Home

[Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Cc: rf13@xxxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Mon, 14 Jan 2002 14:19:44 +0100

Dear diary, on Mon, Jan 14, 2002 at 02:14:24PM CET, I got a letter,
where Raahul Kumar <raahul_da_man@xxxxxxxxx> told me, that...
> > It's cleaning up this function as well? If it does, and it's available
> > somewhere, I would like to see it as an inspiration.
> >
> 
> Ask GB for the current warmap patch. If you like, I can send you the older
> ones I have on hand.
Greg? :)

> > > > -  /* BEGIN PART ONE: Look for huts.  Non-Barbarian Ground units ONLY. 
> > > > */
> > > > +  /*
> > > > +   * PART 1: Look for huts
> > > > +   * Non-Barbarian Ground units ONLY.
> > > > +   */
> > > > +  
> > > 
> > > I prefer your way. It looks like time for a jehad on old style comments.
> > I didn't see similiar style anywhere else.
> 
> I was referring to the way you replaced the previous comment style
> 
> BEGIN PART ONE
> 
> with 
> 
> PART 1 Sentence
> 
> Looks much neater to my eyes.
Sure. Just I dunno what're 'old style comments', as I didn't see this anywhere
else than in this function.

> On threshold, I have not sent it in yet. I'll be sending my igter_speedup
> patch, my initial threshold patch and the want stuff to the ai people soon.
> Let me know if you think it is worthy for general audience.
Post it on the list :).

> > > > +    /* Move cost to the best target (=> lower is better) */
> > > >      int bestcost = maxcost * SINGLE_MOVE + 1;
> > >
> > > You did not explain why we add 1. It's so that we can find other paths
> > > that have the same movecost as the minimum cost one(due to djikstras).
> > > If you do this elsewhere, forget it.
> > I don't agree, I actually think it's much simpler - just this way we can
> > never trigger the goto, as bestcost is higher than maxcost * SINGLE_MOVE.
> > We don't reuse this value anywhere else so I don't think it has a deeper
> > mean.
> 
> That's not what I get from the comment. I'm not quite sure you're right on
> this.  Elsewhere in the movement code we seem to add one to get other paths
> besides the first lowest cost path we found.
Sure, but then we would have to add +1 generally in the bestcost assigment
bellow when we find the path with less cost. I've no idea how it would be able
to help us with finding alternative paths when adding +1 in initialization.

-- 

                                Petr "Pasky" Baudis

UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv, (e)links
.
The advantage of GUI is that you can see everything you can change.
The disadvantage of GUI is that you can change only what you can see.
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/


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