Utility functions
Combine two arrays weighted by a factor favoring arr_1. The first array is to be the estimated real distribution. And the other is to be the personality vector of the agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arr_1
|
array
|
The first array to be combined (real distribution). |
required |
arr_2
|
array
|
The second array to be combined (personality vector). |
required |
factor
|
float
|
The factor to weigh the two arrays. |
required |
Returns:
Name | Type | Description |
---|---|---|
result |
array
|
The normalized weighted linear combination. |
Example
TODO
Source code in democracy_sim/participation_agent.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|