original_docstring: Generates spawn positions for new agents
  
        Default behavior randomly selects a tile position
        along the borders of the square game map
  
        Returns:
           tuple(int, int):
  
           position:
              The position (row, col) to spawn the given agent
        
docstring: Generates spawn positions for new agents
  Default behavior randomly selects a tile position
  along the borders of the square game map
docstring_tokens: Generates spawn positions for new agents Default behavior randomly selects a tile position along the borders of the square game map
code: def SPAWN(self):
        '''Generates spawn positions for new agents
  
        Default behavior randomly selects a tile position
        along the borders of the square game map
  
        Returns:
           tuple(int, int):
  
           position:
              The position (row, col) to spawn the given agent
        '''
        #Spawn at edges
        if self.TERRAIN_MODE == 'contract':
           mmax = self.TERRAIN_SIZE - self.TERRAIN_BORDER - 1
           mmin = self.TERRAIN_BORDER
  
           var  = np.random.randint(mmin, mmax)
           fixed = np.random.choice([mmin, mmax])
           r, c = int(var), int(fixed)
           if np.random.rand() > 0.5:
               r, c = c, r 
           return (r, c)
        #Spawn at center
        else:
           spawnRadius = self.TERRAIN_CENTER_REGION
           spawnWidth  = self.TERRAIN_CENTER_WIDTH
  
           cent  = self.TERRAIN_SIZE // 2
           left  = cent - self.TERRAIN_CENTER_REGION
           right = cent + self.TERRAIN_CENTER_REGION
  
           var  = np.random.randint(left, right)
           if np.random.rand() > 0.5:
              fixed = np.random.randint(left, left+spawnWidth)
           else:
              fixed = np.random.randint(right-spawnWidth, right)
  
           r, c = int(var), int(fixed)
           if np.random.rand() > 0.5:
              r, c = c, r
           return r, c
code_tokens: def SPAWN ( self ) : if self . TERRAIN_MODE == 'contract' : mmax = self . TERRAIN_SIZE - self . TERRAIN_BORDER - 1 mmin = self . TERRAIN_BORDER var = np . random . randint ( mmin , mmax ) fixed = np . random . choice ( [ mmin , mmax ] ) r , c = int ( var ) , int ( fixed ) if np . random . rand ( ) > 0.5 : r , c = c , r return ( r , c ) else : spawnRadius = self . TERRAIN_CENTER_REGION spawnWidth = self . TERRAIN_CENTER_WIDTH cent = self . TERRAIN_SIZE // 2 left = cent - self . TERRAIN_CENTER_REGION right = cent + self . TERRAIN_CENTER_REGION var = np . random . randint ( left , right ) if np . random . rand ( ) > 0.5 : fixed = np . random . randint ( left , left + spawnWidth ) else : fixed = np . random . randint ( right - spawnWidth , right ) r , c = int ( var ) , int ( fixed ) if np . random . rand ( ) > 0.5 : r , c = c , r return r , c
short_docstring: Generates spawn positions for new agents
  Default behavior randomly selects a tile position
  along the borders of the square game map
short_docstring_tokens: Generates spawn positions for new agents Default behavior randomly selects a tile position along the borders of the square game map
comment: '''Generates spawn positions for new agents
  
        Default behavior randomly selects a tile position
        along the borders of the square game map
  
        Returns:
           tuple(int, int):
  
           position:
              The position (row, col) to spawn the given agent
        '''$SEP$#Spawn at edges$SEP$#Spawn at center