unique_name

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

Return a unique name.

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

Parameters
  • base – str (str): base path/string

  • 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