📄 simulation.html
字号:
IMAGE</H3>
<PRE>
public static final java.lang.String <B>IMAGE</B></PRE>
<DL>
<DD>The display mechanism for living beings can be one of: - image - color
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#Simulation.IMAGE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="COLOR"><!-- --></A><H3>
COLOR</H3>
<PRE>
public static final java.lang.String <B>COLOR</B></PRE>
<DL>
<DD>The display mechanism for living beings can be one of: - image - color
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="constant-values.html#Simulation.COLOR">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Simulation(int, int, int, int)"><!-- --></A><H3>
Simulation</H3>
<PRE>
public <B>Simulation</B>(int initialFirstRow, int initialFirstColumn, int initialLastRow, int initialLastColumn)</PRE>
<DL>
<DD>Construct and initialize a new simulation object
<P>
<DT><B>Parameters:</B><DD><CODE>initialFirstRow</CODE> - first row in the lake<DD><CODE>initialFirstColumn</CODE> - first column in the lake<DD><CODE>initialLastRow</CODE> - last row in the lake<DD><CODE>initialLastColumn</CODE> - last column in the lake</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getFirstRow()"><!-- --></A><H3>
getFirstRow</H3>
<PRE>
public int <B>getFirstRow</B>()</PRE>
<DL>
<DD>Get the index of first row in the lake
<P>
<DD><DL>
<DT><B>Returns:</B><DD>first row in simulation</DL>
</DD>
</DL>
<HR>
<A NAME="getFirstColumn()"><!-- --></A><H3>
getFirstColumn</H3>
<PRE>
public int <B>getFirstColumn</B>()</PRE>
<DL>
<DD>Get the index of first column in the lake
<P>
<DD><DL>
<DT><B>Returns:</B><DD>first columns in simulation</DL>
</DD>
</DL>
<HR>
<A NAME="getLastRow()"><!-- --></A><H3>
getLastRow</H3>
<PRE>
public int <B>getLastRow</B>()</PRE>
<DL>
<DD>Get the index of last row in the lake
<P>
<DD><DL>
<DT><B>Returns:</B><DD>last row in simulation</DL>
</DD>
</DL>
<HR>
<A NAME="getLastColumn()"><!-- --></A><H3>
getLastColumn</H3>
<PRE>
public int <B>getLastColumn</B>()</PRE>
<DL>
<DD>Get the index of last column in the lake
<P>
<DD><DL>
<DT><B>Returns:</B><DD>last column in simulation</DL>
</DD>
</DL>
<HR>
<A NAME="getSunlight(int, int)"><!-- --></A><H3>
getSunlight</H3>
<PRE>
public int <B>getSunlight</B>(int row, int column)</PRE>
<DL>
<DD>Get the amount of sunlight shining currently at a given location. Expressed in units of energy.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>row</CODE> - - the row-wise value of location<DD><CODE>column</CODE> - - the column-wise value of location<DT><B>Returns:</B><DD>- an integer that indicates the amount of energy</DL>
</DD>
</DL>
<HR>
<A NAME="getRand()"><!-- --></A><H3>
getRand</H3>
<PRE>
public java.util.Random <B>getRand</B>()</PRE>
<DL>
<DD>Get a random number generator
<P>
<DD><DL>
<DT><B>Returns:</B><DD>random number generator</DL>
</DD>
</DL>
<HR>
<A NAME="getTime()"><!-- --></A><H3>
getTime</H3>
<PRE>
public int <B>getTime</B>()</PRE>
<DL>
<DD>Get the time block currently being simulated.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>current time in simulation</DL>
</DD>
</DL>
<HR>
<A NAME="addLivingBeing(LivingBeing)"><!-- --></A><H3>
addLivingBeing</H3>
<PRE>
public void <B>addLivingBeing</B>(LivingBeing newLivingBeing)</PRE>
<DL>
<DD>Add a living being to the simulation if it does not exist.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newLivingBeing</CODE> - - the living being to be added</DL>
</DD>
</DL>
<HR>
<A NAME="getNeighbors(int, int, int)"><!-- --></A><H3>
getNeighbors</H3>
<PRE>
public java.util.Vector <B>getNeighbors</B>(int row, int column, int distance)</PRE>
<DL>
<DD>Locate all living beings within a specific distance from a given location.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>row</CODE> - - input location<DD><CODE>column</CODE> - - input location<DD><CODE>distance</CODE> - - distance from the input location. A value of of zero will return only cohabitants in the specified cell.<DT><B>Returns:</B><DD>A vector containing living beings in a neighborhood.</DL>
</DD>
</DL>
<HR>
<A NAME="simulateATimeBlock()"><!-- --></A><H3>
simulateATimeBlock</H3>
<PRE>
public void <B>simulateATimeBlock</B>()</PRE>
<DL>
<DD>For all living beings in the simulation, give a little time to live.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Simulation.html" TARGET="_top"><B>NO FRAMES</B></A>
<SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT><A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A></NOSCRIPT></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -