Adapter

class negmas.situated.Adapter(obj, include_adapter_type_name: Optional[bool] = None, include_obj_type_name=True, **kwargs)[source]

Bases: negmas.situated.Agent

Represents an adapter agent that makes some included object act as an agent in some world.

Parameters
  • obj – The object to be adapted.

  • include_adapter_type_name – Whether to include the adapter type name. If None, then it will be included if it does not start with and underscore.

  • include_obj_type_name – Whether to include object type name in this adapter’s type name

  • type_postfix – A string to add to the end of the type name

Remarks:

  • Other than keeping an internal copy of the adapted object under obj, this class is used primarily to provide a way to give good type_name and short_type_name properties that combine the name of the adapter and the name of the enclosed object nicely.

  • The adapted object must be an Entity.

  • The World class uses the type names from this adapter whenever it needs to get a type-name (either type_name or short_type_name)

Attributes Summary

adapted_object

short_type_name

Returns a short name of the type of this entity

type_name

Returns a short name of the type of this entity

Methods Summary

init()

Override this method to modify initialization logic

step()

Override this method to modify stepping logic

Attributes Documentation

adapted_object
short_type_name

Returns a short name of the type of this entity

type_name

Returns a short name of the type of this entity

Methods Documentation

init()[source]

Override this method to modify initialization logic

step()[source]

Override this method to modify stepping logic