private boolean isStackValid ( Agent agent , Stack255 agentExecutionStack ) { if ( agentExecutionStack == null ) { return false ; } final int esSize = agentExecutionStack . size ( ) ; logger . trace ( "{} execution stack is {}/255 full" , Log . logPrefix ( agent . getId ( ) ) , esSize ) ; if ( esSize == 0 ) { return false ; } if ( esSize >= 255 ) { logger . error ( "{} execution stack reached size limit of 255. Cannot continue." , Log . logPrefix ( agent . getId ( ) ) ) ; return false ; } return true ; }
Checks if this agent s execution stack is valid . The stack is valid if it is not null or empty and has not exceeded the maximum size limit of 255 .