negmas.helpers Module

A set of utilities that can be used by agents developed for the platform.

This set of utlities can be extended but must be backward compatible for at least two versions

Functions

get_one_float(rng)

get_one_int(i)

make_range(x)

shortest_unique_names(strs[, sep, …])

Finds the shortest unique strings starting from the end of each input string based on the separator.

create_loggers([file_name, module_name, …])

Create a set of loggers to report feedback.

snake_case(s)

Converts a string from CamelCase to snake_case

camel_case(s[, capitalize_first, lower_first])

Converts a string from snake_case to CamelCase

unique_name(base[, add_time, add_host, …])

Return a unique name.

is_nonzero_file(fpath)

Whether or not the path is for an existing nonzero file.

pretty_string(src[, tab_size, compact])

Recursively print nested elements.

get_class(class_name[, module_name, scope, …])

Imports and creates a class object for the given class name

import_by_name(full_name)

Imports something form a module using its full name

get_full_type_name(t)

Gets the ful typename of a type.

instantiate(class_name[, module_name, scope])

Imports and instantiates an object of a class

humanize_time(secs[, align, …])

Prints time that is given as seconds in human readable form.

gmap(group, param)

Calls or indexes the group by the param

ikeys(x)

Returns all keys of the iterable.

dump(d, file_name[, sort_keys, compact])

Saves an object depending on the extension of the file given.

add_records(file_name, data[, col_names, …])

Adds records to a csv file

load(file_name)

Loads an object depending on the extension of the file given.

exception2str([limit, chain])

is_jsonable(x)

is_lambda_function(obj)

Checks if the given object is a lambda function

is_type(obj)

Checks if the given object is a type converted to string

is_non_lambda_function(obj)

Checks if the given object is not a lambda function

force_single_thread([on])

Forces negmas to use a single thread for all internal calls.

single_thread()

Classes

TimeoutError

The operation exceeded the given deadline.

TimeoutCaller()

ReturnCause(value)

An enumeration.

Distribution(dtype, **kwargs)

Any distribution from scipy.stats with overloading of addition and multiplication.

ConfigReader()

Class Inheritance Diagram

Inheritance diagram of negmas.helpers.TimeoutCaller, negmas.helpers.ReturnCause, negmas.helpers.Distribution, negmas.helpers.ConfigReader