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: Petr Baudis <pasky@xxxxxxxxxxx>
Cc: rf13@xxxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)
From: Raahul Kumar <raahul_da_man@xxxxxxxxx>
Date: Mon, 14 Jan 2002 05:24:23 -0800 (PST)

--- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
> 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? :)
> 

Gregory Berkolaiko. Yes, and I don't call him Greg because we already have a
Greg Wooledge.

> > > > > -  /* 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.
>

I've seen it elsewhere.
 
> > 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.

Hmm, looks like I'm going to have to read this again. You might be right, I'll
get back to you on this.

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


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