socialchoicekit.elicitation_matching module
- class socialchoicekit.elicitation_matching.DoubleLambdaTSF(lambda_1: int = 1, lambda_2: int = 1, zero_indexed: bool = False)[source]
Bases:
object
Double Lambda-Threshold Step Function is the provisional name for applying the binary search-based elicitation technique to get a good distortion for stable matching. The algorithm partitions alternatives into lambda + 1 sets for evey agent to create a simulated value function using binary search. As the cardinal algorithm, this uses Irving’s algorithm for stable matching.
Parameters
- lambda_1int
The number of positions to query for profile_1.
- lambda_2int
The number of positions to query for profile_2.
- zero_indexedbool
If True, the output of the social choice function will be zero-indexed. If False, the output will be one-indexed. One-indexed by default.
- get_simulated_cardinal_profiles(profile_1: ~socialchoicekit.profile_utils.StrictCompleteProfile, profile_2: ~socialchoicekit.profile_utils.StrictCompleteProfile, elicitor_1: ~socialchoicekit.elicitation_utils.IntegerElicitor = <socialchoicekit.elicitation_utils.IntegerSynchronousStdInElicitor object>, elicitor_2: ~socialchoicekit.elicitation_utils.IntegerElicitor = <socialchoicekit.elicitation_utils.IntegerSynchronousStdInElicitor object>) → Tuple[IntegerValuationProfile, IntegerValuationProfile][source]
Obtain the two simulated cardinal profiles.
Parameters
- profile_1: StrictCompleteProfile
A (N, N) array, where N is the number of agents in the first group and also the number of agents in the second group. The element at (i, j) indicates the agent i’s preference for agent j, where 1 is the most preferred agent. Here, agent i belongs to the first group and agent j belongs to the second group.
- profile_2: StrictCompleteProfile
A (N, N) array, where N is the number of agents in the second group and also the number of agents in the first group. The element at (i, j) indicates the agent i’s preference for agent j, where 1 is the most preferred agent. Here, agent i belongs to the second group and agent j belongs to the first group.
- elicitor_1: IntegerElicitor
The elicitor that will be used to query the agents in the first group. By default, IntegerSynchronousStdInElicitor is used. Memoization should be enabled for this elicitor.
- elicitor_2: IntegerElicitor
The elicitor that will be used to query the agents in the first group. By default, IntegerSynchronousStdInElicitor is used. Memoization should be enabled for this elicitor.
Returns
- Tuple[IntegerValuationProfile, IntegerValuationProfile]
The first IntegerValuationProfile is the simulated profile for the first group. The second IntegerValuationProfile is the simulated profile for the second group.
- scf(profile_1: ~socialchoicekit.profile_utils.StrictCompleteProfile, profile_2: ~socialchoicekit.profile_utils.StrictCompleteProfile, elicitor_1: ~socialchoicekit.elicitation_utils.IntegerElicitor = <socialchoicekit.elicitation_utils.IntegerSynchronousStdInElicitor object>, elicitor_2: ~socialchoicekit.elicitation_utils.IntegerElicitor = <socialchoicekit.elicitation_utils.IntegerSynchronousStdInElicitor object>) → List[Tuple[int, int]][source]
The social choice function for this voting rule. Returns agent to agent pairs where each agent is only matched once.
Parameters
- profile_1: StrictCompleteProfile
A (N, N) array, where N is the number of agents in the first group and also the number of agents in the second group. The element at (i, j) indicates the agent i’s preference for agent j, where 1 is the most preferred agent. Here, agent i belongs to the first group and agent j belongs to the second group.
- profile_2: StrictCompleteProfile
A (N, N) array, where N is the number of agents in the second group and also the number of agents in the first group. The element at (i, j) indicates the agent i’s preference for agent j, where 1 is the most preferred agent. Here, agent i belongs to the second group and agent j belongs to the first group.
- elicitor_1: IntegerElicitor
The elicitor that will be used to query the agents in the first group. By default, IntegerSynchronousStdInElicitor is used. Memoization should be enabled for this elicitor.
- elicitor_2: IntegerElicitor
The elicitor that will be used to query the agents in the first group. By default, IntegerSynchronousStdInElicitor is used. Memoization should be enabled for this elicitor.
Returns
- List[Tuple[int, int]]
A list containing assignments (agent_1, agent_2) where agent_1 from the first group is matched to agent_2 from the second group. This list will contain N tuples, where N is the number of agents in each group.