Judgment Call Classes

Classes for modeling Judgment Call method and Auction-based resource [TDO20][TDO19].

class dindpclasses.AuctionModel(params, time_steps, resource_name)

DESCRIPTION

auction_resources(obj, time_step, print_cmd=True, compute_poa=False)

allocate resources based on given types of auction and valuatoin.

Parameters
  • obj (JcModel or InfrastructureGame) – The object that stores the overall decentralized method for which the resource allocation is computed using AuctionModel. The object type that can be passed here should have five attributes: net, layers, results (or results_real for JcModel), and judgments (for computing the valuations).

  • time_step (int) – Time step for which the auction is computed and resoures are allocated.

  • print_cmd (bool, optional) – DESCRIPTION. The default is True.

  • compute_poa (bool, optional) – DESCRIPTION. The default is False.

Returns

Return type

None.

bidding(time_step)
Parameters

time_step (TYPE) – DESCRIPTION.

Returns

Return type

None.

compute_valuations(obj, t_step, print_cmd=True, compute_optimal_valuation=False)

Computes bidders’ valuations and bids for different number of resources

Parameters
  • obj (JcModel instance) – DESCRIPTION.

  • t_step (int) – DESCRIPTION.

  • print_cmd (bool, optional) – DESCRIPTION. The default is True.

  • compute_optimal_valuation (bool, optional) – DESCRIPTION. The default is False.

Returns

Return type

None.

set_resource_unit(resource_name)
Parameters

time_step (TYPE) – DESCRIPTION.

Returns

Return type

None.

class dindpclasses.JcModel(ide, params)

Description

correct_results_real(lyr, t_step)
Parameters
  • lyr (TYPE) – DESCRIPTION.

  • t_step (TYPE) – DESCRIPTION.

Returns

Return type

None.

id

Basic attributes

output_dir

Results attributes

recal_result_sum(t_step)
Parameters

t_step (TYPE) – DESCRIPTION.

Returns

Return type

None.

resource

Resource allocation attributes

save_object_to_file(sample)
Parameters

sample (TYPE) – DESCRIPTION.

Returns

Return type

None.

save_results_to_file(sample)
Parameters

sample (TYPE) – DESCRIPTION.

Returns

Return type

None.

static set_algo(algorithm)
Parameters

algorithm (TYPE) – DESCRIPTION.

Returns

DESCRIPTION.

Return type

str

set_network(params)
Parameters

params (TYPE) – DESCRIPTION.

Returns

DESCRIPTION.

Return type

TYPE

set_out_dir(root, mag)
Parameters
  • root (TYPE) – DESCRIPTION.

  • mag (TYPE) – DESCRIPTION.

Returns

output_dir – DESCRIPTION.

Return type

TYPE

static set_time_steps(T, num_iter)
Parameters
  • T (TYPE) – DESCRIPTION.

  • num_iter (TYPE) – DESCRIPTION.

Returns

num_iter – DESCRIPTION.

Return type

TYPE

class dindpclasses.JudgmentModel(params, t_steps)

Description

create_judgment_dict(obj, layers_tbj, T=1, judge_type_forced=None)

Creates a functionality map for input into the functionality parameter in the indp function.

Parameters
  • obj (JcModel instance) – DESCRIPTION.

  • layers_tbj (list) – List of layers to be judged, which can be different from all layers of the network or controlled layers.

  • T (int, optional) – DESCRIPTION. The default is 1

Returns

functionality – DESCRIPTION.

Return type

TYPE

static demand_based_priority_list(N, layers_tbj)

This function generates the prioirt list for the demand-based judgment Here, an agent judges that the dependee node in the dependee network is repaired until the next time step with the probability that is equal to the demand/supply value of the dependee node divided by the maximum demand/supply value in the dependee network. Also, based on the probability, a judgment is generated for the dependee node.

Parameters
  • N (InfrastructureNetwork instance) – DESCRIPTION.

  • layers_tbj (list) – List of layers to be judged, which can be different from all layers of the network or controlled layers.

Returns

prob – DESCRIPTION.

Return type

TYPE

save_judgments(obj, judge_dict, lyr, t_step)

only for damage dependee nodes and their depndents :param obj: DESCRIPTION. :type obj: TYPE :param judge_dict: DESCRIPTION. :type judge_dict: TYPE :param lyr: DESCRIPTION. :type lyr: TYPE :param t_step: DESCRIPTION. :type t_step: TYPE

Returns

Return type

None.

class dindpclasses.ResourceModel(params, time_steps)

DESCRIPTION

set_lf_res(params)
Parameters

params (TYPE) – DESCRIPTION.

Returns

Return type

None.

set_optimal_res(params)
Parameters

params (TYPE) – DESCRIPTION.

Returns

Return type

None.

set_uniform_res(params)
Parameters

params (TYPE) – DESCRIPTION.

Returns

Return type

None.