|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Creates a sample population of kidney donor-patient pairs and generates a graph which is then written into a DCOP problem statement. More...
Classes | |
| enum | ABO |
| Blood types. More... | |
| enum | PRA |
| Panel Reactive Antibody levels. More... | |
| class | PatientDonorPair |
| A patient-donor pair. More... | |
Public Member Functions | |
| KidneyExchange (int nbrPairs) | |
| Constructor. | |
| Document | generateProblem (final boolean intensional, final boolean stoch, final boolean consistency) |
| Generates an XCSP-formatted document. | |
Static Public Member Functions | |
| static void | main (String[] args) |
| Creates a random problem instance and writes it to a file. | |
Static Public Attributes | |
| static final String | outputDir = "./" |
| Directory to which the files are output. | |
| static final double | bloodO = 48.14/100 |
| Frequency of blood type O. | |
| static final double | bloodA = 33.73/100 |
| Frequency of blood type A. | |
| static final double | bloodB = 14.28/100 |
| Frequency of blood type B. | |
| static final double | sexF = 40.9/100 |
| Frequency of women among the patients. | |
| static final double | relationSpouse = 48.97/100 |
| Frequency of spouse donors. | |
| static final double | lowPRA = 70.19/100 |
| Frequency of low PRA. | |
| static final double | mediumPRA = 20.00/100 |
| Frequency of medium PRA. | |
| static final double | posXmatchLowPRA = 0.05 |
| Probability of positive cross-matches for low PRA. | |
| static final double | posXmatchMediumPRA = 0.45 |
| Probability of positive cross-matches for medium PRA. | |
| static final double | posXmatchHighPRA = 0.9 |
| Probability of positive cross-matches for high PRA. | |
| static final double | negXmatchHusbandDonorFactor = 0.75 |
| Negative cross-match modifier for husband donors (i.e. | |
Static Private Member Functions | |
| static void | arcConsistency (HashMap< Integer, TreeSet< Integer > > canGiveTo, HashMap< Integer, TreeSet< Integer > > canGetFrom) |
| Enforces arc consistency. | |
| static PatientDonorPair | generatePair (int id, PRA pra) |
| Generates a PatientDonorPair according to the probabilities given. | |
| static ABO | convertABO (double d) |
| Helper method which returns the blood type corresponding to the probability given. | |
| static PRA | convertPRA (double d) |
| Returns the discretized PRA corresponding to the given double. | |
| static boolean | ABOcompatible (ABO donorType, ABO patientType) |
| Checks the blood-type compatibility of a patient-donor pair. | |
| static boolean | positiveXmatch (PRA pra, boolean husbandDonor) |
| Returns true for positive X match with probability depending on several factors. | |
| static String | implode (TreeSet<?> set, String sep) |
| static String | toDOT (HashMap< Integer, TreeSet< Integer > > canGiveTo) |
| Generates a DOT representation of the compatibility graph. | |
Private Attributes | |
| HashMap< Integer, PatientDonorPair > | pairs |
| The patient-donor pairs, indexed by their IDs. | |
Creates a sample population of kidney donor-patient pairs and generates a graph which is then written into a DCOP problem statement.
The method used to generate pairs is roughly the same as the one described in: Susan L. Saidman, Alvin E. Roth, Tayfun Sonmez, M. Utku Unver, and Francis L. Delmonico. Increasing the opportunity of live kidney donation by matching for two- and three-way exchanges. Transplantation, 81(5):773-782, March 15 2006.
| frodo2.benchmarks.kidneys.KidneyExchange.KidneyExchange | ( | int | nbrPairs | ) |
Constructor.
| nbrPairs | the desired number of (incompatible) patient-donor pairs |
References frodo2.benchmarks.kidneys.KidneyExchange.PatientDonorPair.compatible, generatePair(), and pairs.
Referenced by frodo2.benchmarks.kidneys.KidneyExchange.PatientDonorPair.canGiveTo(), convertABO(), convertPRA(), generatePair(), main(), frodo2.benchmarks.kidneys.KidneyExchange.PatientDonorPair.PatientDonorPair(), and positiveXmatch().

|
staticprivate |
Checks the blood-type compatibility of a patient-donor pair.
| donorType | the donor type |
| patientType | the patient type |
References frodo2.benchmarks.kidneys.KidneyExchange.ABO.AB, and frodo2.benchmarks.kidneys.KidneyExchange.ABO.O.
|
staticprivate |
Enforces arc consistency.
Arc consistency means that I should not get a kidney from anyone if I cannot give one back in return, and vice-versa.
| canGiveTo | for each donor, its compatible patients |
| canGetFrom | for each patient, its compatible donors |
Referenced by generateProblem().
|
staticprivate |
Helper method which returns the blood type corresponding to the probability given.
| d | in [0,1] probability Double |
References frodo2.benchmarks.kidneys.KidneyExchange.ABO.A, frodo2.benchmarks.kidneys.KidneyExchange.ABO.AB, frodo2.benchmarks.kidneys.KidneyExchange.ABO.B, KidneyExchange(), and frodo2.benchmarks.kidneys.KidneyExchange.ABO.O.

|
staticprivate |
Returns the discretized PRA corresponding to the given double.
| d | in [0,1] |
References frodo2.benchmarks.kidneys.KidneyExchange.PRA.HIGH, KidneyExchange(), frodo2.benchmarks.kidneys.KidneyExchange.PRA.LOW, and frodo2.benchmarks.kidneys.KidneyExchange.PRA.MED.
Referenced by generatePair().

|
staticprivate |
Generates a PatientDonorPair according to the probabilities given.
| id | the pair ID |
| pra | indicates the PRA of the patient |
References convertPRA(), and KidneyExchange().
Referenced by KidneyExchange().

| Document frodo2.benchmarks.kidneys.KidneyExchange.generateProblem | ( | final boolean | intensional, |
| final boolean | stoch, | ||
| final boolean | consistency ) |
Generates an XCSP-formatted document.
| intensional | whether to use intensional constraints |
| stoch | whether to produce a StochDCOP |
| consistency | whether to apply arc consistency |
References arcConsistency(), frodo2.benchmarks.kidneys.KidneyExchange.PatientDonorPair.canGiveTo(), implode(), pairs, and toDOT().
Referenced by main().

|
staticprivate |
| set | the set |
| sep | separator |
Referenced by generateProblem().
|
static |
Creates a random problem instance and writes it to a file.
| args | nbrPairs |
References generateProblem(), and KidneyExchange().

|
staticprivate |
Returns true for positive X match with probability depending on several factors.
| pra | the patient PRA |
| husbandDonor | whether the donor is the patient's husband |
References KidneyExchange(), frodo2.benchmarks.kidneys.KidneyExchange.PRA.LOW, and frodo2.benchmarks.kidneys.KidneyExchange.PRA.MED.

|
staticprivate |
Generates a DOT representation of the compatibility graph.
| canGiveTo | for each donor, the list of patients it can give to |
Referenced by generateProblem().
|
static |
Frequency of blood type A.
|
static |
Frequency of blood type B.
|
static |
Frequency of blood type O.
|
static |
Frequency of low PRA.
|
static |
Frequency of medium PRA.
|
static |
Negative cross-match modifier for husband donors (i.e.
p of neg xmatch is 0.75 times that of a random donor)
|
static |
Directory to which the files are output.
|
private |
The patient-donor pairs, indexed by their IDs.
Referenced by generateProblem(), and KidneyExchange().
|
static |
Probability of positive cross-matches for high PRA.
|
static |
Probability of positive cross-matches for low PRA.
|
static |
Probability of positive cross-matches for medium PRA.
|
static |
Frequency of spouse donors.
|
static |
Frequency of women among the patients.