unique_name

negmas.helpers.unique_name(base, add_time=True, add_host=False, rand_digits=8, sep='/')[source]

Return a unique name.

Can be used to return a unique directory name on the givn base.

Parameters:
  • base – (any): base path/string (it is converted to string whatever it is)

  • add_time (bool, optional) – Defaults to True. Add current time

  • rand_digits (int, optional) – Defaults to 8. The number of random characters to add to the name

Examples

>>> a = unique_name("")
>>> len(a) == 8 + 1 + 6 + 8 + 6
True
Returns:

The unique name.

Return type:

str