|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Module that intercepts messages during UTIL and VALUE propagation and obfuscates the variable names, variable domains, and utility values. More...

Public Member Functions | |
| VariableObfuscation (DCOPProblemInterface< V, U > problem, Element parameters) | |
| Constructor. | |
| Decision | notifyOut (Message msg) |
| Collection< MessageType > | getMsgTypes () |
| void | setQueue (Queue queue) |
| void | notifyIn (Message msg) |
| Public Member Functions inherited from frodo2.communication.OutgoingMsgPolicyInterface< T > | |
| default Decision | notifyOut (Object fromAgent, Message msg) |
| Notifies the listener of an outgoing message. | |
| default Decision | notifyOut (Object fromAgent, Message msg, Collection<? extends Object > toAgents) |
| Notifies the listener of an outgoing message. | |
| default Decision | notifyOut (Message msg, Collection<? extends Object > toAgents) |
| Notifies the listener of an outgoing message. | |
| Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T > | |
| default void | notifyIn (Message msg, Object toAgent) |
| Notifies the listener of an incoming message. | |
Static Public Attributes | |
| static final MessageType | CODE_NAME_TYPE = new MessageType ("P-DPOP", "VariableObfuscation", "Code_Name") |
| The type of the messages containing code names. | |
| static final MessageType | OBFUSCATED_VALUE_TYPE = new MessageType ("P-DPOP", "VariableObfuscation", "VALUE") |
| The type of obfuscated VALUE messages. | |
| static final MessageType | OBFUSCATED_UTIL_TYPE = new MessageType ("P-DPOP", "VariableObfuscation", "UTIL") |
| The type of obfuscated UTIL messages. | |
Private Member Functions | |
| void | generateCodeName (String var) |
| In mergeBack mode: Generates one codeName for the input variable Without mergeBack mode: Initiate general codeName map only. | |
| void | generateUtilObfuscKeys (String var) |
| In mergeBack mode: Generates a range of utilityKey for the input variable Without mergeBack mode: Initiate general utilityKey map only. | |
| void | generateNewCodeName (String myVar, String child) |
| Generates a new codeName and new utility keys for the couple myVar-child and add it in the corresponding generals tables. | |
| void | initiateAllMaps (String var) |
| Initiates all maps for the input variable. | |
| String | randomCodeName () |
| Create a random integer of 32 bits and return it in hex-decimal string form. | |
| V[] | randomDomain (V[] initDom) |
| Generates a domain of random numbers. | |
| V | getTranslatedValue (String myVar, String other, V value, boolean decode) |
| Translates (decodes or encodes) a specified value of the domain of variable other. | |
| void | init () |
| Initiates the variableObfuscation module. | |
| void | init (String var) |
| Initiates all datastructures related to the input variable. | |
| void | generateObfuscatedDomains (String var) |
| In mergeBack mode: Generates an obfuscated domain for the input variable. | |
| void | sendDelayedMsg (String myVar) |
| Send the delayed UTILmsg. | |
| void | addReverseMap (String parent, String myVar, String codeName, V[] domain, V[] obfuscatedDomain, AddableBigInteger[] utilityKeys) |
| Puts in the reverse maps the assignment codeName-variable and parent-domain for a given child variable. | |
| String | decodeCodeName (String myVar, String codeName) |
| Returns the variable assigned with the given codeName if and only if the variable who want to decode is a child or a pseudo child of the coded variable. | |
| String | encodeCodeName (String myVar, String parent) |
| Returns the codeName assigned with the given parent if and only if the variable who wants to decode is a child or a pseudo child of the coded variable. | |
| V[] | decodeDomain (String myVar, String parent) |
| Returns the parent's cleartext domain if and only if the variable who wants to decode is a child or wants to decode its own domain. | |
| V[] | encodeDomain (String myVar, String parent) |
| Returns the parent's obfuscated domain if and only if the variable who wants to obfuscate is a child or wants to obfuscate its own domain. | |
| AddableBigInteger[] | encryptUtility (String myVar, String parent) |
| AddableBigInteger[] | decryptUtility (String myVar, String child) |
| AddableBigInteger[] | decryptMySelfUtility (String myVar, String child) |
Private Attributes | |
| Random | rand = new SecureRandom() |
| A random Stream. | |
| Map< String, String > | codeNamesMerged = new HashMap<String, String>() |
| A Map containing assignments variable-codeName with mergeBack. | |
| Map< String, Map< String, String > > | codeNamesUnique = new HashMap<String, Map<String, String>>() |
| A Map containing assignment variable-codeName without mergeBack: (Pseudo-)Parent - Child - CodeName. | |
| Map< String, V[]> | obfuscatedMergedDomains = new HashMap<String, V[]>() |
| A Map containing assignments variable-domain with mergeBack. | |
| Map< String, Map< String, V[]> > | obfuscatedUniqueDomains = new HashMap<String, Map<String, V[]>>() |
| A Map containing assignments variable-domain without mergeBack: (Pseudo-)Parent - Child - Domain. | |
| Map< String, AddableBigInteger[]> | utilKeyMerged = new HashMap<String, AddableBigInteger[]>() |
| A Map containing assignments of obfuscation keys to all variables of this agent. | |
| Map< String, Map< String, AddableBigInteger[]> > | utilKeyUnique = new HashMap<String, Map<String, AddableBigInteger[]>>() |
| A Map containing assignments of obfuscation keys without mergeBack: (Pseudo-)Parent - Child - UtilKey. | |
| Map< String, Map< String, String > > | decodeCodeName = new HashMap<String, Map<String, String>>() |
| Map for all variables of this agent of reverse map assignment codeName-variable of their (pseudo-)parents: Child - Parents' CodeName - (Pseudo-)Parent. | |
| Map< String, Map< String, String > > | encodeParent = new HashMap<String, Map<String, String>>() |
| Map for all variables of this agent of map assignment variable-codeName of their (pseudo-)parents: Child - (Pseudo-)Parent - Parents' CodeName. | |
| Map< String, Map< String, List< V[]> > > | decodeDomains = new HashMap<String, Map< String, List<V[]> >>() |
| Map for all variables of this agent of map assignment variable-domain of their (pseudo-)parents: Child - (Pseudo-)Parent - Domain. | |
| Map< String, Map< String, AddableBigInteger[]> > | receivedUtilKey = new HashMap<String, Map<String, AddableBigInteger[]>>() |
| Map for all variables of this agent of maps of variable-utility obfuscation key assignments Child - (Pseudo-)Parent - Utility key. | |
| Map< String, Map< String, AddableBigInteger[]> > | ownUtilKey = new HashMap<String, Map<String, AddableBigInteger[]>>() |
| own - (myChild OR myCodeName sent to myChild) - myUTIL | |
| Map< String, Integer > | numDecrypt = new HashMap<String, Integer>() |
| Map with : Parent - Number of time utilities in UTILmsg must be decrypted. | |
| Map< String, String > | parents = new HashMap<String, String>() |
| The true parent of each of this agent's variables in the DFS. | |
| final boolean | mergeBack |
| If mergeBackEdges are allowed. | |
| final AddableBigInteger | infeasibleUtil |
| Long.MIN_VALUE if the problem is a maximization problem, Long.MAX_VALUE otherwise. | |
| final int | numBits |
| The size of the BigInteger for the utility obfuscation. | |
| final int | default_numBits = 128 |
| The size by default of the BigInteger used for utility obfuscation. | |
| Map< String, Integer > | incomingExpected = new HashMap<String, Integer>() |
| For each internal variable, the number of codeName messages it is still expecting. | |
| Map< String, ArrayList< UTILmsg< V, AddableBigInteger > > > | waitingMsg = new HashMap<String, ArrayList<UTILmsg<V, AddableBigInteger>>>() |
| Set of all waiting msg. | |
| Map< String, Boolean > | hasDecoded = new HashMap<String, Boolean>() |
| Map that says if a variable has decoded a UTIL. | |
| Map< String, Map< String, ArrayList< String > > > | utilContent = new HashMap<String, Map<String, ArrayList<String>>>() |
| Map with the UTIL codeNames received (used without mergeBack). | |
| Queue | queue |
| The agent's queue. | |
| boolean | started = false |
| Whether the algorithm has already started. | |
| DCOPProblemInterface< V, U > | problem |
| Problem description. | |
Module that intercepts messages during UTIL and VALUE propagation and obfuscates the variable names, variable domains, and utility values.
| <V> | the type used for variable values |
| <U> | the type used for utility values, in stats gatherer mode only (in normal mode, AddableBigInteger is used) |
| frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.VariableObfuscation | ( | DCOPProblemInterface< V, U > | problem, |
| Element | parameters ) |
Constructor.
| problem | problem description |
| parameters | if mergeBackEdges feature is used or not |
References default_numBits, infeasibleUtil, mergeBack, numBits, problem, and VariableObfuscation().
Referenced by sendDelayedMsg(), and VariableObfuscation().

|
private |
Puts in the reverse maps the assignment codeName-variable and parent-domain for a given child variable.
| parent | the parent that sent this message |
| myVar | the given child variable that received the assignment codeName-variable from its parent |
| codeName | The code name of the parent |
| domain | the domain of the parent variable, in cleartext |
| obfuscatedDomain | the obfuscated domain of the parent |
| utilityKeys | the utility obfuscation keys of the parent |
References decodeCodeName, decodeDomains, encodeParent, and receivedUtilKey.
Referenced by notifyOut().
|
private |
Returns the variable assigned with the given codeName if and only if the variable who want to decode is a child or a pseudo child of the coded variable.
Else, return null
| myVar | the variable who want to decode the codeName |
| codeName | the codeName to decode |
References decodeCodeName.
|
private |
Returns the parent's cleartext domain if and only if the variable who wants to decode is a child or wants to decode its own domain.
Else, returns null
| myVar | the variable who want to decode the domain |
| parent | the parent whose domain has to be decoded |
References decodeDomains.
Referenced by getTranslatedValue().
|
private |
| myVar | the variable that wants to decrypt its own utility keys |
| child | the child to whom myVar has sent this utilityKey |
References frodo2.solutionSpaces.crypto.AddableBigInteger.flipSign(), and ownUtilKey.

|
private |
| myVar | the variable that called this method |
| child | the variable whose utility keys we want |
References frodo2.solutionSpaces.crypto.AddableBigInteger.flipSign(), and receivedUtilKey.

|
private |
Returns the codeName assigned with the given parent if and only if the variable who wants to decode is a child or a pseudo child of the coded variable.
Else, returns null
| myVar | the variable who wants to decode the codeName |
| parent | the parent to encode |
References encodeParent.
|
private |
Returns the parent's obfuscated domain if and only if the variable who wants to obfuscate is a child or wants to obfuscate its own domain.
Else, returns null
| myVar | the variable who wants to obfuscate the domain |
| parent | the parent whose domain has to be obfuscated |
null if this parent's domain is unknown. References decodeDomains.
Referenced by getTranslatedValue().
|
private |
| myVar | the variable that called this method |
| parent | the variable whose utility keys we want |
References receivedUtilKey.
|
private |
In mergeBack mode: Generates one codeName for the input variable Without mergeBack mode: Initiate general codeName map only.
| var | the variable |
References codeNamesMerged, codeNamesUnique, mergeBack, and randomCodeName().
Referenced by init().

|
private |
Generates a new codeName and new utility keys for the couple myVar-child and add it in the corresponding generals tables.
| myVar | the var that generates the codeName |
| child | the child who will receive msg that contains myVar's codeName |
References codeNamesUnique, mergeBack, numBits, obfuscatedUniqueDomains, problem, rand, randomCodeName(), randomDomain(), and utilKeyUnique.
Referenced by notifyOut().

|
private |
In mergeBack mode: Generates an obfuscated domain for the input variable.
Without mergeBack mode: Only initiates the table
| var | the variable |
References mergeBack, obfuscatedMergedDomains, obfuscatedUniqueDomains, problem, and randomDomain().
Referenced by init().

|
private |
In mergeBack mode: Generates a range of utilityKey for the input variable Without mergeBack mode: Initiate general utilityKey map only.
| var | the variable |
References mergeBack, numBits, problem, rand, utilKeyMerged, and utilKeyUnique.
Referenced by init().
| Collection< MessageType > frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References CODE_NAME_TYPE, OBFUSCATED_UTIL_TYPE, OBFUSCATED_VALUE_TYPE, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.OPT_UTIL_MSG_TYPE, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG_TYPE, and frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.VALUE_MSG_TYPE.
|
private |
Translates (decodes or encodes) a specified value of the domain of variable other.
| myVar | the variable who calls this method |
| other | the variable who owns the value to translate |
| value | the value to be translated |
| decode | true if myVar wants to decode the value, false if myVar wants to encode the value |
null References decodeDomain(), and encodeDomain().

|
private |
Initiates the variableObfuscation module.
References hasDecoded, init(), and problem.
Referenced by init(), and notifyIn().

|
private |
Initiates all datastructures related to the input variable.
| var | the variable |
References generateCodeName(), generateObfuscatedDomains(), generateUtilObfuscKeys(), and initiateAllMaps().

|
private |
Initiates all maps for the input variable.
| var | the variable |
References decodeCodeName, decodeDomains, encodeParent, incomingExpected, mergeBack, ownUtilKey, receivedUtilKey, utilContent, and waitingMsg.
Referenced by init().
| void frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References CODE_NAME_TYPE, frodo2.communication.MessageType.equals(), init(), notifyIn(), OBFUSCATED_UTIL_TYPE, and started.
Referenced by notifyIn(), and sendDelayedMsg().

| Decision frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.notifyOut | ( | Message | msg | ) |
Implements frodo2.communication.OutgoingMsgPolicyInterface< T >.
References addReverseMap(), codeNamesMerged, codeNamesUnique, decodeCodeName, decodeDomains, frodo2.communication.MessageType.equals(), generateNewCodeName(), incomingExpected, mergeBack, notifyOut(), numDecrypt, obfuscatedMergedDomains, obfuscatedUniqueDomains, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, ownUtilKey, parents, problem, queue, utilContent, utilKeyMerged, and utilKeyUnique.
Referenced by notifyOut(), and sendDelayedMsg().

|
private |
Create a random integer of 32 bits and return it in hex-decimal string form.
References rand.
Referenced by generateCodeName(), and generateNewCodeName().
|
private |
Generates a domain of random numbers.
| initDom | the initial domain |
References randomDomain().
Referenced by generateNewCodeName(), generateObfuscatedDomains(), and randomDomain().

|
private |
Send the delayed UTILmsg.
| myVar | the var who can send its UTILmsg |
References frodo2.communication.MessageType.equals(), notifyIn(), notifyOut(), problem, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.UTIL_MSG_TYPE, VariableObfuscation(), and waitingMsg.

| void frodo2.algorithms.dpop.privacy.VariableObfuscation< V extends Addable< V >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue.
|
static |
The type of the messages containing code names.
Referenced by frodo2.algorithms.dpop.privacy.CodeNameMsg< V extends Addable< V > >.CodeNameMsg(), frodo2.algorithms.dpop.privacy.CodeNameMsg< V extends Addable< V > >.CodeNameMsg(), frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.getMsgTypes(), getMsgTypes(), frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.notifyIn(), and notifyIn().
|
private |
A Map containing assignments variable-codeName with mergeBack.
Referenced by generateCodeName(), and notifyOut().
|
private |
A Map containing assignment variable-codeName without mergeBack: (Pseudo-)Parent - Child - CodeName.
Referenced by generateCodeName(), generateNewCodeName(), and notifyOut().
|
private |
Map for all variables of this agent of reverse map assignment codeName-variable of their (pseudo-)parents: Child - Parents' CodeName - (Pseudo-)Parent.
Referenced by addReverseMap(), decodeCodeName(), initiateAllMaps(), and notifyOut().
|
private |
Map for all variables of this agent of map assignment variable-domain of their (pseudo-)parents: Child - (Pseudo-)Parent - Domain.
Cleartext domain in [0], obfuscated domain in [1]
Referenced by addReverseMap(), decodeDomain(), encodeDomain(), initiateAllMaps(), and notifyOut().
|
private |
The size by default of the BigInteger used for utility obfuscation.
Referenced by VariableObfuscation().
|
private |
Map for all variables of this agent of map assignment variable-codeName of their (pseudo-)parents: Child - (Pseudo-)Parent - Parents' CodeName.
Referenced by addReverseMap(), encodeCodeName(), and initiateAllMaps().
|
private |
Map that says if a variable has decoded a UTIL.
Referenced by init().
|
private |
For each internal variable, the number of codeName messages it is still expecting.
Referenced by initiateAllMaps(), and notifyOut().
|
private |
Long.MIN_VALUE if the problem is a maximization problem, Long.MAX_VALUE otherwise.
Referenced by VariableObfuscation().
|
private |
If mergeBackEdges are allowed.
Referenced by generateCodeName(), generateNewCodeName(), generateObfuscatedDomains(), generateUtilObfuscKeys(), initiateAllMaps(), notifyOut(), and VariableObfuscation().
|
private |
The size of the BigInteger for the utility obfuscation.
Referenced by generateNewCodeName(), generateUtilObfuscKeys(), and VariableObfuscation().
|
private |
Map with : Parent - Number of time utilities in UTILmsg must be decrypted.
Referenced by notifyOut().
|
static |
The type of obfuscated UTIL messages.
Referenced by frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.getMsgTypes(), getMsgTypes(), notifyIn(), frodo2.algorithms.dpop.privacy.ObsfUTILmsg< V extends Addable< V > >.ObsfUTILmsg(), and frodo2.algorithms.dpop.privacy.ObsfUTILmsg< V extends Addable< V > >.ObsfUTILmsg().
|
static |
The type of obfuscated VALUE messages.
Referenced by frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.getMsgTypes(), getMsgTypes(), frodo2.algorithms.dpop.privacy.ObfsVALUEmsg< V extends Addable< V > >.ObfsVALUEmsg(), and frodo2.algorithms.dpop.privacy.ObfsVALUEmsg< V extends Addable< V > >.ObfsVALUEmsg().
|
private |
A Map containing assignments variable-domain with mergeBack.
Referenced by generateObfuscatedDomains(), and notifyOut().
|
private |
A Map containing assignments variable-domain without mergeBack: (Pseudo-)Parent - Child - Domain.
Referenced by generateNewCodeName(), generateObfuscatedDomains(), and notifyOut().
|
private |
own - (myChild OR myCodeName sent to myChild) - myUTIL
Referenced by decryptMySelfUtility(), initiateAllMaps(), and notifyOut().
|
private |
The true parent of each of this agent's variables in the DFS.
Referenced by notifyOut().
|
private |
Problem description.
Referenced by generateNewCodeName(), generateObfuscatedDomains(), generateUtilObfuscKeys(), init(), notifyOut(), sendDelayedMsg(), and VariableObfuscation().
|
private |
The agent's queue.
Referenced by notifyOut(), and setQueue().
|
private |
A random Stream.
Referenced by generateNewCodeName(), generateUtilObfuscKeys(), and randomCodeName().
|
private |
Map for all variables of this agent of maps of variable-utility obfuscation key assignments Child - (Pseudo-)Parent - Utility key.
Referenced by addReverseMap(), decryptUtility(), encryptUtility(), and initiateAllMaps().
|
private |
Whether the algorithm has already started.
Referenced by notifyIn().
|
private |
Map with the UTIL codeNames received (used without mergeBack).
Variable X - Children of X - CodeName(s) of X
Referenced by initiateAllMaps(), and notifyOut().
|
private |
A Map containing assignments of obfuscation keys to all variables of this agent.
Referenced by generateUtilObfuscKeys(), and notifyOut().
|
private |
A Map containing assignments of obfuscation keys without mergeBack: (Pseudo-)Parent - Child - UtilKey.
Referenced by generateNewCodeName(), generateUtilObfuscKeys(), and notifyOut().
|
private |
Set of all waiting msg.
Referenced by initiateAllMaps(), and sendDelayedMsg().