swarm-support
[Top][All Lists]
Advanced

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

[Swarm-Support] Re:Support Digest, Vol 38, Issue 2


From: yuefengch
Subject: [Swarm-Support] Re:Support Digest, Vol 38, Issue 2
Date: Sat, 11 Aug 2007 07:10:07 +0800 (CST)

hi,
   Thank you give me help on display. I want to get the example you have realized in double model and cast(int)display. 
   Thank you!
                            yuefengch 
Message: 2
Date: Thu, 09 Aug 2007 19:03:12 -0500
From: Paul Johnson <address@hidden>
Subject: Re: [Swarm-Support] display
To: Swarm Support <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain; charset=GB2312

yuefengch wrote:
>  
> hello,
>   How to display the continuous space in Swarm. Only may Value2dDisplay and Object2dDisplay supply 2 dimension displaying of discrete space?
>   Now I define a space througy double x,y, how to display them?
>   Thank you!
>                   yuefengch
>  
>   
THe screen of a computer is inherently a grid of pixels. Hence the best
you can do is decide how big you want the grid to be on your screen and
then inside the agents, convert the doubles to integers before you do
the drawing on the raster. In my models, I have agents who are on a
double based space, but on the grid display, the discretization is done
with a cast (int), as in

[r drawPointX: [self getCoordinate:space*2] Y:(int) [self
getCoordinate:1+space*2] Color: policyColor];

Although that method does not round up. You can use C library functions
floor() or such.

-- 
Paul E. Johnson                       email: address@hidden
Professor, Political Science          http://pj.freefaculty.org
1541 Lilac Lane, Rm 504                              
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700



------------------------------

Message: 3
Date: Fri, 10 Aug 2007 18:25:53 +0530
From: "Kavita Gangal" <address@hidden>
Subject: [Swarm-Support] Query with Swarm
To: "Swarm Support" <address@hidden>
Message-ID:
	<address@hidden>
Content-Type: text/plain; charset="iso-8859-1"




8·15 《大 话 西 游 3》动 人 公 测!点 击 此 处 抢 先 下 载 最 新 客 户 端 >>
reply via email to

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