swarm-support
[Top][All Lists]
Advanced

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

space.h proposed patch here (was Re: Swarm interfaces


From: pauljohn
Subject: space.h proposed patch here (was Re: Swarm interfaces
Date: Tue, 17 Jul 2001 05:49:03 -0500

"Marcus G. Daniels" wrote:
 
> PJ> What do you think of requiring a "smaller" interface with just
> PJ> those methods for objects referred to in the setDiscrete2dToDisplay in
> PJ> the Value2dDisplay.m file?  That interface would be adopted by Grid2d.
> 
> Fine..  Code-as-a-proposal is better than a proposal-for-code.  Easier
> to review, easier to fix, and easier to install.

The FArguments thing may take me a while, but how about this for
my space idea. I was not sure if the methods listed in the
GridData protocol should be removed from Discrete2 protocol, so
I did not remove them.
I have no creative instinct in naming classes/protocols.

*** space.h     Sun Apr 30 11:49:28 2000
--- space.h-new Tue Jul 17 05:36:58 2001
***************
*** 23,29 ****
  #import <objectbase.h>
  #import <gui.h> // Raster, Colormap

! @protocol Discrete2d <SwarmObject, CREATABLE>
  //S: Root class of all 2d discrete spaces.

  //D: A Discrete2d is basically a 2d array of ids.
--- 23,53 ----
  #import <objectbase.h>
  #import <gui.h> // Raster, Colormap

! @protocol GridData
! //S: Methods required by widgets that display grids.  User
defined
! //S: space objects must adopt this or any implementor of it
! //S: in order to be accepted as
! //S: data providers in the setDiscrete2dToDisplay method of
! //S: Value2dDisplay objects.  User spaces must also define the
! //S: macro discrete2dSiteAt(), versions of which can be
! //S: found in Grid2d.h or Discrete2d.h
!
! //M: Get the size of the lattice in the X dimension.
! - (unsigned)getSizeX;
!
! //M: Get the size of the lattice in the Y dimension.
! - (unsigned)getSizeY;
!
!
! //M: Returns the lattice pointer - use this for fast access.
! - (id *)getLattice;
!
! - (long *)getOffsets;
!
! @end
!
!
! @protocol Discrete2d <SwarmObject, CREATABLE, GridData>
  //S: Root class of all 2d discrete spaces.

  //D: A Discrete2d is basically a 2d array of ids.
***************
*** 203,215 ****

  CREATING
  //M: Convenience constructor for Value2dDisplay
! + create: (id <Zone>)aZone setDisplayWidget: (id <Raster>)r
colormap: (id <Colormap>)c setDi
screte2dToDisplay: (id <Discrete2d>)d;

  //M: Set the display widget and the colourmap to use to draw
the value array.
  - setDisplayWidget: (id <Raster>)r colormap: (id <Colormap>)c;

  //M: Set which array to draw.
! - setDiscrete2dToDisplay: (id <Discrete2d>)c;

  USING
  //M: Linear transform of states to colours for drawing.
--- 227,239 ----

  CREATING
  //M: Convenience constructor for Value2dDisplay
! + create: (id <Zone>)aZone setDisplayWidget: (id <Raster>)r
colormap: (id <Colormap>)c setDi
screte2dToDisplay: (id <GridData>)d;

  //M: Set the display widget and the colourmap to use to draw
the value array.
  - setDisplayWidget: (id <Raster>)r colormap: (id <Colormap>)c;

  //M: Set which array to draw.
! - setDiscrete2dToDisplay: (id <GridData>)c;

  USING
  //M: Linear transform of states to colours for drawing.



-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science           
http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   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]