swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] binary numbers


From: Konrad_Richter
Subject: Re: [Swarm-Support] binary numbers
Date: Tue, 8 Jul 2003 11:02:11 +0200

Hi Marcello,
you could create a list [bitstring] for the agent, consisting of single
elements which take the values 0 or 1. The elements should have the
functions setVal and getVal (do not call them setValue and getValue, since
otherwise SWARM gets mixed up with some other functions it uses
internally). Then, the i-th value could be obtained by [[[agent
getBitstring] atOffset: i] getVal] - where the function getBitstring
returns the above mentioned list.
Hope, that helps,
greetings,
     Konrad


|--------+----------------------->
|        |           Marcello    |
|        |           <m.gallucci@|
|        |           psy.vu.nl>  |
|        |           Sent by:    |
|        |           support-admi|
|        |           address@hidden |
|        |           08.07.2003  |
|        |           10:32       |
|        |           Please      |
|        |           respond to  |
|        |           support     |
|        |                       |
|--------+----------------------->
  
>-----------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                          |
  |       To:     address@hidden                                                
                                       |
  |       cc:     (bcc: Konrad Richter/VIE/Europe/MCKINSEY)                     
                                          |
  |       Subject:     [Swarm-Support] binary numbers                           
                                          |
  
>-----------------------------------------------------------------------------------------------------------------------|




Sorry if this comes a bit off the topic:
Does anybody have a nice and clean way to handle binary numbers. I would
like to store some information about the agent as a binary number
(0100101), and have a call that returns exactly the digit I'd like.
Thus, if the agent has myBin=01001, the call [agent gimmeBin: 1] returns
0, [agent gimmeBin: 2] returns 1, [agent gimmeBin: 3] returns 0, and so
on. Of course, I could write gimmeBin as a sequence of if-then, but it
does not sound very neat.
Any hint?
thanks
marcello
On Fri, 2003-07-04 at 15:03, Paul Johnson wrote:
> au contraire!
>
> I have put both swarm-2.1.143 and 2.1.145 up there some time ago.
>
> Although the swarm link to the ftp server won't let me in now, I can get
> there from
>
> ftp://ftp.santafe.edu/pub/swarm/src/testing.
>
> Agustin Ramos Fonseca wrote:
> > Thank you for your advise.
> >
> > I'd like to know where I can get the swarm 2.1.143.20030512 sources,
> > I looked for them at
> > ftp://ftp.swarm.org/pub/swarm/src/testing/
> > but they aren't there.
> >
> > I'll try to upgrade my RH to 7.3 but I think my old PC won't support it
> > (mainly because disk space, all rpm updates are disk consuming)
> >
> > I'm interested in the sources because I'm interested in modelling and
> > in the inner workings of this tool. So I'll try to build the sources.
> >
> > Thanks again
> >
> > Agustín T.Ramos Fonseca
>
>
> --
> Paul E. Johnson                       email: address@hidden
> Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
> University of Kansas                  Office: (785) 864-9086
> Lawrence, Kansas 66045                FAX: (785) 864-5700
>
> _______________________________________________
> Support mailing list
> address@hidden
> http://www.swarm.org/mailman/listinfo/support
--
Marcello Gallucci (Ph.D)
Department of Social Psychology
Free University
Van der Boechorststraat 1
1081 BT Amsterdam (NL)
Tel. +31(0)20 4448846
Fax  +31 (0)20 4448921

_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support




+---------------------------------------------------------+
This message may contain confidential and/or privileged
information.  If you are not the addressee or authorized to
receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein.  If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message.  Thank you for your cooperation.
+---------------------------------------------------------+




reply via email to

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