class_docstr: Controller.`
  Keep Track of each ship and shipyard
docstr: Take action
  Args:
      board (envs.halite.helpers.Board): the environment 
      method (str) : sampling action or use greedy action
  Return:
      action (dict) : a dictionary recording the action for each ship and shipyard
docstr_tok: ["Take","action","Args",":","board","(","envs.halite.helpers.Board",")",":","the","environment","method","(","str",")",":","sampling","action","or","use","greedy","action","Return",":","action","(","dict",")",":","a","dictionary","recording","the","action","for","each","ship","and","shipyard"]
code: def take_action(self, board, method="sample"):
      """Take action
      Args:
          board (envs.halite.helpers.Board): the environment
          method (str) : sampling action or use greedy action
      Return:
          action (dict) : a dictionary recording the action for each ship and shipyard
      """
  
      if self.init:
          self.update_state(board)
  
      if not hasattr(self, "board"):
          self.reset(board)
  
      # take action for ships
      self.take_ship_action(board, method)
  
      # take action for shipyards
      self.take_shipyard_action(board)
  
      me = board.current_player
  
      self.board = board
  
      return me.next_actions
  
imports: import numpy
  from config import config
  from zerosum_env.envs.halite.helpers import *
  from .agent import Agent
  from .model import Model
  from .algorithm import PPO
  from .obs_parser import get_ship_feature
  from .replay_memory import ReplayMemory
  from .utils import is_alive, check_nearby_ship, nearest_shipyard_position, mahattan_distance
  from .policy import do_nothing_policy, move_up_policy, move_down_policy, move_left_policy, move_right_policy, spawn_policy, return_to_base_policy, mine_policy, convert_policy
label_desc: Use image node_id 6 for calling the Controller obj's underlying member method code with example usage: obj.take_action(board, method) and returns: me