📄 swarm.space.grid2d.protocol.html
字号:
<HTML><HEAD><TITLE>Grid2d</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.53"><LINKREL="HOME"TITLE="Documentation Set for Swarm 2.1.1"HREF="set.html"><LINKREL="UP"TITLE="Space Library"HREF="swarm.space.sgml.reference.html"><LINKREL="PREVIOUS"TITLE="Discrete2d"HREF="swarm.space.discrete2d.protocol.html"><LINKREL="NEXT"TITLE="Int2dFiler"HREF="swarm.space.int2dfiler.protocol.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Documentation Set for Swarm 2.1.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="swarm.space.discrete2d.protocol.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Reference X. Space Library</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="swarm.space.int2dfiler.protocol.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SWARM.SPACE.GRID2D.PROTOCOL">Grid2d</A></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN23180"></A><H2>Name</H2>Grid2d -- A 2d container class for agents.</DIV><DIVCLASS="REFSECT1"><ANAME="AEN23183"></A><H2>Description</H2><P> Grid2d is a generic container class to represent agent position on a 2d lattice. It gets most of its behaviour from Discrete2d, adding extra code to check that you don't overwrite things by accident. Grid2d is pretty primitive: only one object can be stored at a site, no boundary conditions are implied, etc.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN23186"></A><H2>Protocols adopted by Grid2d</H2><P> <AHREF="swarm.space.discrete2d.protocol.html">Discrete2d</A> <AHREF="swarm.defobj.creatable.protocol.html">CREATABLE</A></P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN23191"></A><H2>Methods</H2><DIVCLASS="REFSECT2"><ANAME="AEN23193"></A><H3>Phase: Creating</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SPACE.GRID2D.METHOD.PC.M41"></A><P></P>+ <BCLASS="FUNCPROTOTYPE">create:</B> (id <Zone>)<VARCLASS="PDPARAM">aZone</VAR> <BCLASS="FUNCPROTOTYPE">setSizeX:</B> (unsigned)<VARCLASS="PDPARAM">x</VAR> <BCLASS="FUNCPROTOTYPE">Y:</B> (unsigned)<VARCLASS="PDPARAM">y</VAR> <BR> Convenience constructor for Grid2d<P></P></DIV></LI></UL></DIV><DIVCLASS="REFSECT2"><ANAME="AEN23209"></A><H3>Phase: Using</H3><P></P><UL><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SPACE.GRID2D.METHOD.PU.M621"></A><P></P>- <BCLASS="FUNCPROTOTYPE">putObject:</B> <VARCLASS="PDPARAM">anObject</VAR> <BCLASS="FUNCPROTOTYPE">atX:</B> (unsigned)<VARCLASS="PDPARAM">x</VAR> <BCLASS="FUNCPROTOTYPE">Y:</B> (unsigned)<VARCLASS="PDPARAM">y</VAR> <BR> Replaces the Discrete2d method. First check to see if it should do overwrite warnings, and if so if you're going to overwrite: if both conditions are true, print out a warning message. Regardless of the check, it writes the new object in. <P></P></DIV></LI><LI><DIVCLASS="FUNCSYNOPSIS"><ANAME="SWARM.SPACE.GRID2D.METHOD.PU.M817"></A><P></P>- <BCLASS="FUNCPROTOTYPE">setOverwriteWarnings:</B> (BOOL)<VARCLASS="PDPARAM">b</VAR> <BR> If set to true, then if you try to store something at a site that doesn't have 0x0 there, a warning will be generated. <P></P></DIV></LI></UL></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="swarm.space.discrete2d.protocol.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="set.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="swarm.space.int2dfiler.protocol.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Discrete2d</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="swarm.space.sgml.reference.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Int2dFiler</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -