📄 ant.ctxt
字号:
#BlueJ class context
comment0.target=class\ Ant
comment0.text=Class\ for\ representing\ and\ drawing\ Ants.\n@author\ Jo\ Wood\n@version\ 1.2,\ 23rd\ August,\ 2001.\n\n
comment1.params=
comment1.target=int\ getMaxFood()
comment1.text=Reports\ much\ food\ can\ be\ carried\ by\ the\ ant.\n@return\ Number\ of\ food\ units\ the\ ant\ can\ carry.\n\n
comment10.params=
comment10.target=Color\ getColour()
comment10.text=Reports\ the\ colour\ of\ this\ ant.\n@return\ Colour\ of\ this\ ant.\n\n
comment11.target=foodSize
comment12.target=MUTATION
comment13.params=foodUnits
comment13.target=void\ eat(int)
comment13.text=Lets\ the\ ant\ eat\ some\ food\ and\ updates\ the\ size\ of\ any\ncarried\ food.\n@param\ foodUnits\ Number\ of\ food\ units\ to\ eat.\n\n
comment14.params=
comment14.target=void\ evolve()
comment14.text=Let\ the\ ant\ go\ about\ its\ business\ for\ one\ time\ unit.\n\n
comment15.params=foodUnits
comment15.target=void\ metabolise(int)
comment15.text=Let\ the\ ant\ metabolise\ some\ food\ and\ updates\ the\ size\ of\ any\ncarried\ food.\n@param\ foodUnits\ Number\ of\ food\ units\ to\ metabolise.\n\n
comment16.target=colour
comment17.params=
comment17.target=void\ changeAntDirection()
comment17.text=Sets\ a\ new\ direction\ for\ ant\ to\ walk\ in.\n\n
comment18.target=MAX_STRAIGHT_STEPS
comment19.params=g
comment19.target=void\ paint(Graphics)
comment19.text=Draws\ the\ ant\ using\ the\ given\ graphics\ context.\n@param\ g\ Graphics\ context\ to\ draw\ to.\n\n
comment2.params=gListener
comment2.target=void\ addGraphicsListener(GraphicsListener)
comment2.text=Adds\ a\ graphics\ listener\ to\ this\ ant.\ Allows\ graphics\ to\ be\ndrawn\ by\ a\ GraphicsListener.\n@param\ gListener\ Component\ doing\ the\ drawing.\n\n
comment20.target=homingInstinct
comment21.target=HEIGHT
comment22.target=FEED_RATE
comment23.target=numSteps
comment24.target=gListener
comment25.target=xDir
comment26.target=goingHome
comment27.target=maxFood
comment28.params=foodLevel\ x\ y\ colour\ nest
comment28.target=Ant(int,float,float,Color,Nest)
comment28.text=Creates\ an\ ant\ with\ a\ given\ food\ level\ and\ location.\n@param\ foodLevel\ Initial\ food\ level\ of\ the\ ant.\n@param\ x\ Initial\ x\ location\ of\ the\ ant.\n@param\ y\ Initial\ y\ location\ of\ the\ ant.\n@param\ colour\ Colour\ of\ ant.\n@param\ nest\ Nest\ in\ which\ this\ ant\ was\ born.\n\n
comment29.params=foodLevel\ parent\ x\ y\ nest
comment29.target=Ant(int,Ant,float,float,Nest)
comment29.text=Creates\ an\ ant\ with\ similar\ characteristics\ of\ the\ given\nparent.\ Applies\ a\ small\ genetic\ mutation\ to\ inherited\ characteristics.\n@param\ foodLevel\ Initial\ food\ level\ of\ the\ ant.\n@param\ parent\ Ant\ supplying\ inheritable\ characteristics.\n@param\ x\ Initial\ x\ location\ of\ the\ ant.\n@param\ y\ Initial\ y\ location\ of\ the\ ant.\n@param\ nest\ Nest\ in\ which\ this\ ant\ was\ born.\n\n
comment3.target=DONATION_LEVEL
comment30.target=nest
comment31.target=yDir
comment32.target=METABOLIC_RATE
comment4.target=MAX_FOOD
comment5.params=
comment5.target=float\ getHomingInstinct()
comment5.text=Reports\ the\ homing\ instinct\ of\ the\ ant.\ Instinct\ varies\ between\n0\ and\ 1\ and\ represents\ the\ probability\ that\ the\ ant\ will\ move\nin\ a\ nestward\ direction\ whenever\ it\ changes\ direction.\ \ \n@return\ Homing\ instinct\ between\ 0\ and\ 1.\ \n\n
comment6.params=
comment6.target=int\ getStraightSteps()
comment6.text=Reports\ how\ many\ steps\ the\ ant\ will\ take\ before\ considering\nchanging\ direction.\n@return\ Number\ of\ straight\ steps\ taken.\n\n
comment7.target=WIDTH
comment8.target=MAX_HOMING_INSTINCT
comment9.target=straightSteps
numComments=33
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -