swarm-support
[Top][All Lists]
Advanced

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

Re: Heatbug Pixmap, Importation and Redhat question...


From: bleydorf
Subject: Re: Heatbug Pixmap, Importation and Redhat question...
Date: Sat, 16 Aug 1997 10:41:42 -0400

Benedikt Stefansson wrote:
> 
> address@hidden wrote:
> 
> > All,
> > How was the Heatbug Pixmap created?
> 
> The pixmap is contained in ant.xpm it is an array holding information in
> XPM format (X Pixmap).
> 
> Although I have no familiarity with this format it seems to include a
> header (size of pixmap in pixels and number of colors), definitions of
> symbols and then a "pixmap" using these symbols. There doesn't seem to
> be any documentation in the Swarmdocs on the XPM format, the XPixmap
> class uses some low level X sorcery which I'd rather not know to much
> about.

Actually after I sent this question, I loaded it (on my home PC, without
Linux or Swarm) and put it in a MS-Line Printer Font, which all the
characters are the same size.  And it finally made sense to me.  I
figured, I could just re-save it twice, and go in and make the 8 * 8
pixmap a different bug, like the baby bug, and smaller heatbug and a
dead bug a bug on its back with its legs in the air.

> If you look at the code in HeatbugModelSwarm.m.pixmap, it reads this
> array and creates an XPixmap object to process it. The pointer to the
> XPixmap instance is then passed to each individual heatbug. In
> Heatbug.m.pixmap instead of drawing itself on the raster in a particular
> color the heatbug now sends the pixmap to the raster.
> 
> > I want to create some more
> > different ones to give the heatbugs a visible lifecycle (BabyBug,
> > matureBug, deadbug) etc.
> 
> I want, I want. It's always the same with you kids. You'd have to create
> new pixmaps (figure out the format) for each representation of the bugs,
> have ModelSwarm wrap each of these files in a seperate XPixmap instance,
> and send the bugs info on which pixmap to send to the raster in each
> case (e.g. if age<maturity use baby.xpm, if age>maturity use mature.xpm
> etc.)

How old do you think I am?  I just turned 31.  But, I am immature
though...[grin].
 
> > Is it possible to have heatbug import HeatbugModelSwarm.h so it can
> > create a heatbugModelSwarm within Heatbug?  It seems to me that it
> > would be some sort of endless loop A imports B, and B imports A,
> > repeat.
> > If I wanted to do this would this work: Have a
> > heatbugProtoModelSwarm which both heatbugModelSwarm and Heatbug
> > could import, this way I could avoid any possible "endless loops"?
> 
> You can make each individual agent/heatbug into a ModelSwarm. Question
> is why you would want to do that in the first place. If you just need a
> reference to the model in each bug, define a -setModel: m method and
> have the model send each bug a pointer to itself.
> 
> If you want to elevate each bug to the status of an independent
> sub-Swarm you don't need to _import_ the model or create a
> "ProtoModelSwarm". Just create a new class called BugModelSwarm with the
> behavior in it that you want (i.e. all the bug does and then whatever
> else you need). Then in the top level ModelSwarm you create multiple
> instances of a BugModelSwarm instead of Bug. And call it a bug as
> before. The only advantage of raising a bug to the level of an
> independent Swarm is that you can use the scheduling mechanism in each
> bug, and then merge (activateIn) these schedules into the top level
> ModelSwarm.

I am trying to get heatbugs to reproduce, and the way someone suggested
it, was to put the code into the bug, but it has to refer to the
HeatbugModelSwarm with-in it.  But, I tried it yesterday, and it didnt
like it for sure, so my reasoning was that if A imports B and B imports
A, maybe it would be better if A imported C and B imported C, C being
the protoModelSwarm...

> > Has anyone else using Redhat on a PC (with a two button mouse) had
> > trouble getting the probe heatbug thingy to work in Heatbugs.  I
> > stop a
> > simulation, attempt to click on a bug, and the computer just beeps
> > at
> > me...am I doing this wrong?  I even went in and changed the code to
> > select the right and left buttons, but it still wouldn't work...
> 
> I've used numerous installations of RedHat (4.0 or greater) on different
> PCs to demo Heatbugs and the probe thingy always works. Are you sure
> that you are clicking the _right button_ on a bug? They may be hard to
> hit with the cursor since a bug is just the size of a pixel, so try a
> few times, the beep is the correct behavior when you hit the background
> instead of a bug.

I'll try it some more.
Thanks,
Brad.

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

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