FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.benchmarks.kidneys.KidneyExchange Class Reference

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, PatientDonorPairpairs
 The patient-donor pairs, indexed by their IDs.

Detailed Description

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.

Author
Jonas Helfer, Thomas Leaute

Constructor & Destructor Documentation

◆ KidneyExchange()

frodo2.benchmarks.kidneys.KidneyExchange.KidneyExchange ( int nbrPairs)

Member Function Documentation

◆ ABOcompatible()

boolean frodo2.benchmarks.kidneys.KidneyExchange.ABOcompatible ( ABO donorType,
ABO patientType )
staticprivate

Checks the blood-type compatibility of a patient-donor pair.

Parameters
donorTypethe donor type
patientTypethe patient type
Returns
compatibility

References frodo2.benchmarks.kidneys.KidneyExchange.ABO.AB, and frodo2.benchmarks.kidneys.KidneyExchange.ABO.O.

◆ arcConsistency()

void frodo2.benchmarks.kidneys.KidneyExchange.arcConsistency ( HashMap< Integer, TreeSet< Integer > > canGiveTo,
HashMap< Integer, TreeSet< Integer > > canGetFrom )
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.

Parameters
canGiveTofor each donor, its compatible patients
canGetFromfor each patient, its compatible donors

Referenced by generateProblem().

◆ convertABO()

ABO frodo2.benchmarks.kidneys.KidneyExchange.convertABO ( double d)
staticprivate

Helper method which returns the blood type corresponding to the probability given.

Parameters
din [0,1] probability Double
Returns
the blood type corresponding to given probability

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.

Here is the call graph for this function:

◆ convertPRA()

PRA frodo2.benchmarks.kidneys.KidneyExchange.convertPRA ( double d)
staticprivate

Returns the discretized PRA corresponding to the given double.

Parameters
din [0,1]
Returns
the PRA

References frodo2.benchmarks.kidneys.KidneyExchange.PRA.HIGH, KidneyExchange(), frodo2.benchmarks.kidneys.KidneyExchange.PRA.LOW, and frodo2.benchmarks.kidneys.KidneyExchange.PRA.MED.

Referenced by generatePair().

Here is the call graph for this function:

◆ generatePair()

PatientDonorPair frodo2.benchmarks.kidneys.KidneyExchange.generatePair ( int id,
PRA pra )
staticprivate

Generates a PatientDonorPair according to the probabilities given.

Parameters
idthe pair ID
praindicates the PRA of the patient
Returns
the pair

References convertPRA(), and KidneyExchange().

Referenced by KidneyExchange().

Here is the call graph for this function:

◆ generateProblem()

Document frodo2.benchmarks.kidneys.KidneyExchange.generateProblem ( final boolean intensional,
final boolean stoch,
final boolean consistency )

Generates an XCSP-formatted document.

Parameters
intensionalwhether to use intensional constraints
stochwhether to produce a StochDCOP
consistencywhether to apply arc consistency
Returns
Document the XCSP problem instance
Todo
Make it possible to use the DOTrenderer

References arcConsistency(), frodo2.benchmarks.kidneys.KidneyExchange.PatientDonorPair.canGiveTo(), implode(), pairs, and toDOT().

Referenced by main().

Here is the call graph for this function:

◆ implode()

String frodo2.benchmarks.kidneys.KidneyExchange.implode ( TreeSet<?> set,
String sep )
staticprivate
Parameters
setthe set
sepseparator
Returns
the elements (toString) of the array concatenated with sep

Referenced by generateProblem().

◆ main()

void frodo2.benchmarks.kidneys.KidneyExchange.main ( String[] args)
static

Creates a random problem instance and writes it to a file.

Parameters
argsnbrPairs

References generateProblem(), and KidneyExchange().

Here is the call graph for this function:

◆ positiveXmatch()

boolean frodo2.benchmarks.kidneys.KidneyExchange.positiveXmatch ( PRA pra,
boolean husbandDonor )
staticprivate

Returns true for positive X match with probability depending on several factors.

Parameters
prathe patient PRA
husbandDonorwhether the donor is the patient's husband
Returns
true if positive x match

References KidneyExchange(), frodo2.benchmarks.kidneys.KidneyExchange.PRA.LOW, and frodo2.benchmarks.kidneys.KidneyExchange.PRA.MED.

Here is the call graph for this function:

◆ toDOT()

String frodo2.benchmarks.kidneys.KidneyExchange.toDOT ( HashMap< Integer, TreeSet< Integer > > canGiveTo)
staticprivate

Generates a DOT representation of the compatibility graph.

Parameters
canGiveTofor each donor, the list of patients it can give to
Returns
a DOT representation of the compatibility graph

Referenced by generateProblem().

Member Data Documentation

◆ bloodA

final double frodo2.benchmarks.kidneys.KidneyExchange.bloodA = 33.73/100
static

Frequency of blood type A.

◆ bloodB

final double frodo2.benchmarks.kidneys.KidneyExchange.bloodB = 14.28/100
static

Frequency of blood type B.

◆ bloodO

final double frodo2.benchmarks.kidneys.KidneyExchange.bloodO = 48.14/100
static

Frequency of blood type O.

◆ lowPRA

final double frodo2.benchmarks.kidneys.KidneyExchange.lowPRA = 70.19/100
static

Frequency of low PRA.

◆ mediumPRA

final double frodo2.benchmarks.kidneys.KidneyExchange.mediumPRA = 20.00/100
static

Frequency of medium PRA.

◆ negXmatchHusbandDonorFactor

final double frodo2.benchmarks.kidneys.KidneyExchange.negXmatchHusbandDonorFactor = 0.75
static

Negative cross-match modifier for husband donors (i.e.

p of neg xmatch is 0.75 times that of a random donor)

◆ outputDir

final String frodo2.benchmarks.kidneys.KidneyExchange.outputDir = "./"
static

Directory to which the files are output.

◆ pairs

HashMap<Integer, PatientDonorPair> frodo2.benchmarks.kidneys.KidneyExchange.pairs
private

The patient-donor pairs, indexed by their IDs.

Referenced by generateProblem(), and KidneyExchange().

◆ posXmatchHighPRA

final double frodo2.benchmarks.kidneys.KidneyExchange.posXmatchHighPRA = 0.9
static

Probability of positive cross-matches for high PRA.

◆ posXmatchLowPRA

final double frodo2.benchmarks.kidneys.KidneyExchange.posXmatchLowPRA = 0.05
static

Probability of positive cross-matches for low PRA.

◆ posXmatchMediumPRA

final double frodo2.benchmarks.kidneys.KidneyExchange.posXmatchMediumPRA = 0.45
static

Probability of positive cross-matches for medium PRA.

◆ relationSpouse

final double frodo2.benchmarks.kidneys.KidneyExchange.relationSpouse = 48.97/100
static

Frequency of spouse donors.

◆ sexF

final double frodo2.benchmarks.kidneys.KidneyExchange.sexF = 40.9/100
static

Frequency of women among the patients.


The documentation for this class was generated from the following file: