adf_core_python.core.agent.communication.standard.utility package#

Submodules#

adf_core_python.core.agent.communication.standard.utility.apply_to_world_info module#

adf_core_python.core.agent.communication.standard.utility.apply_to_world_info.apply_to_world_info(world_info: WorldInfo, standard_message: StandardMessage) None#

Apply to world info.

パラメータ:
  • world_info (WorldInfo) -- The world info to apply to.

  • standard_message (StandardMessage) -- The standard message to apply to world info.

adf_core_python.core.agent.communication.standard.utility.bitarray_with_exits_flag module#

adf_core_python.core.agent.communication.standard.utility.bitarray_with_exits_flag.read_with_exist_flag(bit_array: bitarray, size: int) int | None#

Read value from bit_array with an exist flag. If the first bit is IS_NOT_EXIST_FLAG, return None. If the first bit is IS_EXIST_FLAG, read and return value from bit_array.

パラメータ:
  • bit_array (bitarray) -- The bitarray to read from.

  • size (int) -- The number of bits to read to get value.

戻り値:

The value read from bit_array.

戻り値の型:

Optional[int]

例外:

ValueError -- If the first bit is not IS_EXIST_FLAG or IS_NOT_EXIST_FLAG.

adf_core_python.core.agent.communication.standard.utility.bitarray_with_exits_flag.write_with_exist_flag(bit_array: bitarray, value: int | None, bit_size: int) None#

Write value to bit_array with an exist flag. If value is None, write IS_NOT_EXIST_FLAG to bit_array. If value is not None, write IS_EXIST_FLAG to bit_array and then write value to bit_array.

パラメータ:
  • bit_array (bitarray) -- The bitarray to write to.

  • value (Optional[int]) -- The value to write.

  • bit_size (int) -- The number of bits to use to write value.

例外:

ValueError -- If value is too large to fit into bit_size bits.

Module contents#