bgp.probability package

Submodules

bgp.probability.preference module

class bgp.probability.preference.PreMap(data)

Bases: numpy.ndarray

2D probability map

add_new()

add new features to self

down_other_point(*sv)

Use for binding.rate the others and add the subbed value to the [index1,index2] the rate are [0,1).

Parameters

sv ([index1,index2,rate]) – site to set value

classmethod from_shape(shape)

Generation.

Parameters

shape (int) – shape of premap.

Returns

Return type

PreMap

get_ind_value(ind, pset)

get the value according to ind

Parameters
Returns

Return type

probability list

get_indexes_value(indexes, weight=None)
Parameters
  • indexes (tuple, indexes) – get the value of average of indexes affect

  • weight (None, tuple,np.ndarray) – the same size with self.shape[0]

Returns

Return type

probability list

get_nodes_value(ind=None, pset=None, node=None, site=None)

get affect value except sites nodes.

Parameters
Returns

Return type

probability list

get_one_node_value(ind=None, pset=None, node=None, site=None)

get affect value except site node.

Parameters
Returns

Return type

probability list

noise()

add noise with 1% scale

set_ratio(*sv)

Rate the [index1,index2] to sum and add the subbed value to the others. under check.

Parameters

sv ([index1,index2,rate]) – rate in [0,n), if [0,1) down, if [1,n) up.

set_ratio_point(*sv)

Rate the [index1,index2] to self and add the subbed value to the others. under check.

Parameters

sv ([index1,index2,rate]) –

in [0,n)

[0,1) down,

[1,n) up

set_sigle_point(*sv)

set the value of [index1,index2] the rate are [0,1)

Parameters

sv ([index1,index2,rate]) – site to set value

update(ind, pset, ratio=0.5)
Parameters
  • ind (SymbolTree) – individual

  • pset (SymbolSet) – SymbolSet

  • ratio (float [0,1]) – change ratio

Returns

Return type

self

Module contents