Skip to content

Commit

Permalink
Improve stable matching example
Browse files Browse the repository at this point in the history
  • Loading branch information
natsuozawa committed Mar 31, 2024
1 parent c3cf37f commit c33b6f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example/stable_matching_example.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import numpy as np

from socialchoicekit.profile_utils import StrictCompleteProfile, IntegerValuationProfile, is_consistent_valuation_profile
from socialchoicekit.elicitation_utils import IntegerValuationProfileElicitor
from socialchoicekit.deterministic_matching import GaleShapley, Irving
from socialchoicekit.elicitation_matching import DoubleLambdaTSF

sigma_1 = StrictCompleteProfile.of(np.array([
[4, 3, 2, 1, 5, 6],
Expand Down Expand Up @@ -61,3 +63,10 @@
sw_y = Irving.stable_matching_value(M_y, v_1, v_2)

print(sw_i, sw_x, sw_y)

ivpe_1 = IntegerValuationProfileElicitor(v_1)
ivpe_2 = IntegerValuationProfileElicitor(v_2)
M_d = DoubleLambdaTSF(2, 2, True).scf(sigma_1, sigma_2, ivpe_1, ivpe_2)
sw_d = Irving.stable_matching_value(M_d, v_1, v_2)

print(sw_d)

0 comments on commit c33b6f4

Please sign in to comment.