public class LazynessHelper
extends java.lang.Object
Constructor and Description |
---|
LazynessHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addNeedsToNeedMap(java.util.Set<java.lang.String> needsToAdd,
java.util.Map<java.lang.String,Need> needsMap)
Adds a number of needs characterized through strings to the existing need map.
|
static java.util.Set<Need> |
aggregateNeeds(java.util.Set<ProductGroup> productGroups)
Method to aggregate all needs the provided product groups satisfy.
|
static java.util.Set<Need> |
aggregateNeedsFromProducts(java.util.Set<Product> products)
Method to aggregate all needs the product groups corresponding to the provided products satisfy.
|
static boolean |
allPrerequisiteProductsAdopted(Product potentialProduct,
ConsumerAgent consumerAgentConcerned)
Method that checks whether all prerequisite products of a given product are adopted.
|
static boolean |
anyAdoptedProductRefersToProduct(java.util.Set<AdoptedProduct> adoptedProducts,
Product correspondingProduct)
Method to check whether any of the AdoptedProducts corresponds to a given product
|
static double |
calculateFractionAdoptersInSN(ConsumerAgent consumerAgent,
Product productConcerned,
SimulationContainer simulationContainer)
Method to calculate the fraction of adopters of the product of interest within the social network of the consumer agent of interest
|
static java.lang.Integer |
chooseIntegerByDistribution(java.util.Map<java.lang.Integer,java.lang.Double> integerProbabilityMap)
Method to choose an Integer value from the keyset of the argument
based on its probability density specified as values.
|
static Product |
chooseProduct(java.util.Set<Product> products)
Method to chose a (uniformly) random product from a set of products
|
static Information |
chooseRandomInformation(java.util.Set<Information> informationSet)
Method to choose a random piece of Information from a set of information.
|
static SNNode |
chooseRandomNode(java.util.Set<SNNode> potentialNodes)
Chooses a random node from a set of nodes uniformly
|
static ProductAttributeInformation |
chooseRandomProductAttributeInformation(java.util.Set<ProductAttributeInformation> informationSet)
Method to choose a random piece of ProductAttributeInformation from a set of ProductAttributeInformation.
|
static ConsumerAgentGroup |
chooseTargetCAG(ConsumerAgentGroupAffinities affinities,
ConsumerAgentGroup sourceConsumerAgentGroup)
Method to chose a consumerAgentGroup based on the affinity between consumer agents groups.
|
static int |
countAdoptedAgents(java.util.Set<ConsumerAgent> consumerAgents)
Method to count the number of agents that adopted any product.
|
static int |
countAdoptedAgents(java.util.Set<ConsumerAgent> consumerAgents,
Product productToCheckAdoptionFor)
Method to count the number of agents that adopted the respective product.
|
static int |
countAdoptedAgents(java.util.Set<ConsumerAgent> consumerAgents,
ProductGroup productGroupToCheckAdoptionFor)
Method to count the number of agents that adopted a prodcut from the respective product group.
|
static java.util.Map<Product,java.lang.Integer> |
countNoAdoptersInNeighbourhood(java.util.Set<Product> consideredProducts,
ConsumerAgent consumerAgent,
SimulationContainer simulationContainer)
Method to calculate the number of adopters of a set of products of interest within the social network of the consumer agent of interest
|
static int |
countNodes(java.util.HashMap<java.lang.Integer,java.util.Set<SNNode>> nodesByDegree)
Aggregates the total number of nodes from a list of nodes by degree.
|
static java.util.ArrayList<java.lang.Integer> |
countNoProductsAdoptedPerAgent(java.util.Set<ConsumerAgent> consumerAgents)
Method to compile a list of how many agent adopted a certain number of products.
|
static java.util.Map<ProductGroupAttribute,java.util.Map<Value,java.lang.Double>> |
derivePGAPreferenceMap(PreferenceConfiguration preferenceConfiguration)
Method to derive a ProductGroupAttribute Preference map from a preference configuration.
|
static java.util.Set<ProductGroup> |
deriveProductGroups(java.util.Set<Product> products)
Method to derive the product groups a set of products correspond to.
|
static void |
detectDoubleEdges(java.util.Set<SNEdge> preliminaryEdgeSet,
java.util.Set<SNNode> nodeSet) |
static java.util.Map<java.lang.Integer,java.util.Set<FixedProductDescription>> |
determineInitiallyAdoptedProducts(int numberOfConsumers,
java.util.Map<FixedProductDescription,UnivariateDistribution> initialProductConfiguration)
Method to select the initially adopted products for each agent / distribute the initially adopted products among the agents.
|
static Product |
determineStandardProduct(java.util.Set<Product> consideredProducts,
SimulationContainer simulationContainer)
Method to derive the standard product of a set of products.
|
static boolean |
existsEdge(java.util.Set<SNEdge> edgeSet,
SNNode sourceNode,
SNNode targetNode)
Method to check whether an edge between two nodes already exists in a given set.
|
static Product |
findBestProduct(java.util.Map<Product,java.lang.Integer> productImportanceMap) |
static java.util.Set<Product> |
findBestProducts(java.util.Map<Product,java.lang.Integer> productQualityMap)
Method to find the best products in a map of products and integer values.
|
static boolean |
findCommonOverwriteDecisionMakingProcessProducts(java.util.Set<Product> productsQualifyingForDecisison)
Method to determine if there is a overwrite decision making process common to a set of product.
|
static ProductGroup |
findCommonProductGroup(java.util.Set<Product> potentialProducts)
Method to derive the product group a set of products correspond to.
|
static java.util.Set<FixedProductDescription> |
fixedProductDescriptionsFromProductGroups(java.util.Set<ProductGroup> productGroups)
Method to retrieve all FixedProductDescriptions in the provided product groups
|
static ProductAttribute |
getCompatibilityPA(Product product)
Method to extract the compatibility product attribute of a product (if present).
|
static java.util.Set<Product> |
getConcernedProducts(java.util.Set<MarketIntroductionEvent> mies)
Method to derive the products a set of MarketIntroductionEvent corresponds to
|
static AdoptedProduct |
getCorrespondingAdoptedProduct(java.util.Set<AdoptedProduct> adoptedProducts,
Product respectiveProduct)
Method to find the adoptedProduct in a set of AdoptedProducts that corresponds to given product
|
static SNEdge |
getCorrespondingEdge(SNNode sourceNode,
SNNode targetNode,
java.util.Set<SNEdge> edges)
Retrieves the edge from sourceNode to targetNode in the given set of edges.
|
static Product |
getCorrespondingProduct(SimulationContainer simulationContainer,
FixedProductDescription productConcerned)
Method to retrieve the product corresponding to the FixedProductDescription from the list of products in the simulation container.
|
static java.util.Set<Product> |
getCorrespondingProducts(java.util.Set<AdoptedProduct> adoptedProducts)
Method to derive the products a set of adopted products is based on.
|
static ConsumerAgentAdoptionDecisionProcess |
getEmployedDecisionProcess(ConsumerAgent consumerAgent,
Product product)
Method to see if a product overwrite a decision process / which one would be used for the product adoption by a ConsumerAgent
Will give back the products decision overwrite process (if not null) or else the decision process of the consumer actor
|
static ProductAttribute |
getInvestmentCostPA(Product product)
Method to extract the investmentCost product attribute of a product (if present).
|
static SNNode |
getLeastConnectedNode(java.util.HashMap<java.lang.Integer,java.util.Set<SNNode>> nodesWithDegrees,
boolean selfLoopRegular,
SNNode sourceNode)
Method to find the least (or any of the least) connected node within a list of nodes,
potentially excluding the node to connect
|
static SNNode |
getLeastConnectedNodeUnsafe(java.util.HashMap<java.lang.Integer,java.util.Set<SNNode>> nodesWithDegrees,
boolean selfLoopRegular,
SNNode sourceNode)
Unsafe method to find the least (or any of the least) connected node within a list of nodes,
potentially excluding the node to connect.
|
static double |
getMaximum(java.util.Set<java.lang.Double> doubles) |
static double |
getMinimum(java.util.Set<java.lang.Double> doubles) |
static Product |
getProductByName(java.lang.String productName,
SimulationContainer simulationContainer)
Method to retrieve a product within the simulation by its name.
|
static SNNode |
getRandomSNNode(java.util.Set<SNNode> potentialNodes)
Method to retrieve a random node in the set of SNNodes chosen uniformly distributed
|
static java.util.Set<Need> |
getUnsatisfiedNeeds(ConsumerAgent consumerAgentConcerned)
Method to derive all needs of the consumerAgentConcerned not currently satisfied by any
of the adopted products
|
static java.util.Set<ProductAttribute> |
makeProductAttributesFromProductGroupAttributeValueMap(java.util.Map<ProductGroupAttribute,java.lang.Double> productGroupAttributeValueMap)
Method to transform a map of ProductGroupAttributes and the values along them into ProductAttributes
|
static java.util.ArrayList<Value> |
orderValuesByPreference(java.util.Set<Preference> preferences)
Method to order the Values corresponding to preferences in the parameter set
by their value strength.
|
static java.util.Set<SNNode> |
pickNNodes(java.util.Set<SNNode> nodesToPick,
int noNodesToPick)
Method to randomly choose noNodesToPick nodes from a set of nodes
|
static java.util.Map<Value,java.lang.Double> |
preferenceToValueQuantityMap(java.util.Set<Preference> preferences)
Method to convert a set of preferences to a map of Value-Double pairs
|
static java.util.Set<ProductGroupAttribute> |
productGroupAttributesFromProductGroups(java.util.Set<ProductGroup> productGroups)
Method to bundle all product group attributes present in any of the products in the product group set
|
static ConsumerAgent |
retrieveCorrespondingConsumerAgent(SimulationContainer simulationContainer,
SNNode correspondingNode)
Retrieve the consumer agent corresponding to the given SNNode within the simulation container
|
static java.util.List<Event> |
ScriptedEventToEvent(java.util.List<ScriptedProductEvent> scheduledProductEvents)
Method to cast all entries of type ScriptedProductEvent in a list into an ArrayList of Events (by one-by-one casting them)
|
static java.util.Set<ProductAttribute> |
selectProductAttributes(java.util.Set<Product> productsToExtractFrom)
Method to retrieve all product attributes present in any of the given products
|
static java.util.List<Need> |
sortNeeds(java.util.Set<Need> needsToSatisfy,
NeedDevelopmentScheme needDevelopmentScheme)
Method to sort the needs in a set based on their order in the needDevelopmentScheme.
|
public static java.util.Set<ProductGroupAttribute> productGroupAttributesFromProductGroups(java.util.Set<ProductGroup> productGroups) throws java.lang.IllegalArgumentException
productGroups
- The product groups whose ProductGroupAttributes are to be retrievedjava.lang.IllegalArgumentException
- Will be thrown when the set of product groups is emptypublic static java.util.Set<FixedProductDescription> fixedProductDescriptionsFromProductGroups(java.util.Set<ProductGroup> productGroups)
productGroups
- Set of product groups whose FixedProductDescriptions are to be extractedjava.lang.IllegalArgumentException
- Will be thrown when the set of product groups is emptypublic static SNNode getRandomSNNode(java.util.Set<SNNode> potentialNodes) throws java.lang.IllegalArgumentException
potentialNodes
- The set of which one nodes should be selectedjava.lang.IllegalArgumentException
- will be thrown if the set of nodes to chose from is empty (no node can be chosen frompublic static ConsumerAgent retrieveCorrespondingConsumerAgent(SimulationContainer simulationContainer, SNNode correspondingNode) throws java.lang.IllegalArgumentException
simulationContainer
- The container in which the simulation runscorrespondingNode
- The node for which the ConsumerAgent should be retrievedjava.lang.IllegalArgumentException
- Will be thrown if the given SNNode doesn't have an associated consumer agent within the simulationpublic static java.util.Set<ProductAttribute> selectProductAttributes(java.util.Set<Product> productsToExtractFrom) throws java.lang.IllegalArgumentException
productsToExtractFrom
- The set of products from which the product attributes are to be retrievedjava.lang.IllegalArgumentException
- Will be thrown if the set of products whose product attributes are to be retrieved is emptypublic static SNEdge getCorrespondingEdge(SNNode sourceNode, SNNode targetNode, java.util.Set<SNEdge> edges) throws java.lang.IllegalArgumentException
sourceNode
- The SNNode from which the edge originatestargetNode
- The SNNode to which the edge is directededges
- The set of edges from which the edge from sourceNode to targetNode is to be retrievedjava.lang.IllegalArgumentException
- will be thrown if either of the sourceNode, targetNode or edges is null / emptypublic static Product getCorrespondingProduct(SimulationContainer simulationContainer, FixedProductDescription productConcerned)
simulationContainer
- The container in which the simulation is situatedproductConcerned
- The FixedProductDescription whose corresponding product is to be retrievedjava.lang.IllegalArgumentException
- Will be thrown if the simulation container or the given fixed product description is nullpublic static Product getProductByName(java.lang.String productName, SimulationContainer simulationContainer) throws java.lang.IllegalArgumentException
productName
- The product name whose corresponding product is to be foundsimulationContainer
- The container in which the simulation runsjava.lang.IllegalArgumentException
- Will be thrown when no such product (or multiple such products) exist and thus either product name or the simulation container is illegalpublic static void addNeedsToNeedMap(java.util.Set<java.lang.String> needsToAdd, java.util.Map<java.lang.String,Need> needsMap)
needsToAdd
- Strings corresponding to the needs to addneedsMap
- The need map that is to be modified with the needs to addpublic static java.util.Set<Need> aggregateNeeds(java.util.Set<ProductGroup> productGroups)
productGroups
- The product groups whose needs are to be extractedpublic static java.util.Set<Need> aggregateNeedsFromProducts(java.util.Set<Product> products)
products
- The products whose needs to be satisfied are to be extractedpublic static java.util.Set<Product> getCorrespondingProducts(java.util.Set<AdoptedProduct> adoptedProducts)
adoptedProducts
- The set of adopted products the corresponding products are based onpublic static java.util.Set<Product> getConcernedProducts(java.util.Set<MarketIntroductionEvent> mies)
mies
- The set of MarketIntroductionEvents whose corresponding products should be derivedpublic static boolean allPrerequisiteProductsAdopted(Product potentialProduct, ConsumerAgent consumerAgentConcerned)
potentialProduct
- The product whose prerequisite products are to be checkedconsumerAgentConcerned
- The consumer agent whose adoption is to be tested on adoption of prerequisite product groupspublic static Product chooseProduct(java.util.Set<Product> products) throws java.lang.IllegalArgumentException
products
- The set of products of which one product is to be chosenjava.lang.IllegalArgumentException
- will be thrown if the set to choose from is empty or one of them is nullpublic static int countAdoptedAgents(java.util.Set<ConsumerAgent> consumerAgents)
consumerAgents
- The agents for which to count the number of adoptionspublic static int countAdoptedAgents(java.util.Set<ConsumerAgent> consumerAgents, Product productToCheckAdoptionFor) throws java.lang.IllegalArgumentException
consumerAgents
- The agents for which to count the number of adoptionsproductToCheckAdoptionFor
- The product for which the number of adopters is checkedjava.lang.IllegalArgumentException
- Will be thrown if the product is nullpublic static int countAdoptedAgents(java.util.Set<ConsumerAgent> consumerAgents, ProductGroup productGroupToCheckAdoptionFor) throws java.lang.IllegalArgumentException
consumerAgents
- The agents for which to count the number of adoptionsproductGroupToCheckAdoptionFor
- The product group for which the number of adopters is checkedjava.lang.IllegalArgumentException
- Will be thrown if the productGroup is nullpublic static java.util.ArrayList<java.lang.Integer> countNoProductsAdoptedPerAgent(java.util.Set<ConsumerAgent> consumerAgents)
consumerAgents
- The consumer agents for which to check the number of adopted productspublic static ConsumerAgentGroup chooseTargetCAG(ConsumerAgentGroupAffinities affinities, ConsumerAgentGroup sourceConsumerAgentGroup) throws java.lang.IllegalArgumentException
affinities
- The affinities between consumer agent groupssourceConsumerAgentGroup
- The consumerAgentGroup from which a target group is to be foundjava.lang.IllegalArgumentException
- will be thrown when the consumer agent group affinities don't contain data for the source CAG or one of the affinities is negativepublic static SNNode getLeastConnectedNode(java.util.HashMap<java.lang.Integer,java.util.Set<SNNode>> nodesWithDegrees, boolean selfLoopRegular, SNNode sourceNode) throws java.lang.IllegalArgumentException
nodesWithDegrees
- Map to link the degree of connectivity of a set of nodes to the nodes with that connectivityselfLoopRegular
- Flag to indicate whether self-loops are allowed. If so the source node is allowed to be a return valuesourceNode
- The node from which the connection is made (will be a candidate if selfLoopRegular (and not if not))java.lang.IllegalArgumentException
- will be thrown if there is no legal node to choose (either the node set is empty or only contains the source node and the network is not selfLoopRegular)public static SNNode getLeastConnectedNodeUnsafe(java.util.HashMap<java.lang.Integer,java.util.Set<SNNode>> nodesWithDegrees, boolean selfLoopRegular, SNNode sourceNode) throws java.lang.IllegalArgumentException
nodesWithDegrees
- Map to link the degree of connectivity of a set of nodes to the nodes with that connectivityselfLoopRegular
- Flag to indicate whether self-loops are allowed. If so the source node is allowed to be a return valuesourceNode
- The node from which the connection is made (will be a candidate if selfLoopRegular (and not if not))java.lang.IllegalArgumentException
- will be thrown if there is no legal node to choose (either the node set is empty or only contains the source node and the network is not selfLoopRegular)public static SNNode chooseRandomNode(java.util.Set<SNNode> potentialNodes) throws java.lang.IllegalArgumentException
potentialNodes
- The set of nodes from which the resulting node can be chosenjava.lang.IllegalArgumentException
- Will be thrown if the set of nodes to choose from is emptypublic static java.util.Map<ProductGroupAttribute,java.util.Map<Value,java.lang.Double>> derivePGAPreferenceMap(PreferenceConfiguration preferenceConfiguration)
preferenceConfiguration
- The preference configuration which the map should be extracted from.public static double calculateFractionAdoptersInSN(ConsumerAgent consumerAgent, Product productConcerned, SimulationContainer simulationContainer) throws java.lang.IllegalArgumentException, antlr.SemanticException
consumerAgent
- The consumer agent of interestproductConcerned
- The product for which the fraction of adopters is to be countedsimulationContainer
- The container the simulation runs injava.lang.IllegalArgumentException
- Will be thrown when the product or the consumer agent are null or not part of the simulation containerantlr.SemanticException
- Will be thrown when the agent of interest has no neighbours within the social network (fraction is undefined)public static java.util.Map<Value,java.lang.Double> preferenceToValueQuantityMap(java.util.Set<Preference> preferences) throws java.lang.IllegalArgumentException
preferences
- The preferences to extract the map fromjava.lang.IllegalArgumentException
- Will be thrown if the preference set to be converted is emptypublic static java.util.Set<Product> findBestProducts(java.util.Map<Product,java.lang.Integer> productQualityMap) throws java.lang.IllegalArgumentException
productQualityMap
- Map that assigns a quality to each productjava.lang.IllegalArgumentException
- Will be thrown when the productQualityMap is emptypublic static java.util.Map<Product,java.lang.Integer> countNoAdoptersInNeighbourhood(java.util.Set<Product> consideredProducts, ConsumerAgent consumerAgent, SimulationContainer simulationContainer) throws java.lang.IllegalArgumentException, antlr.SemanticException
consideredProducts
- The set of products for which the number of adopters is to be countedconsumerAgent
- The consumer agent whose neighbours adoption patterns are to be countedsimulationContainer
- The container the simulation runs injava.lang.IllegalArgumentException
- Will be thrown when the products or the consumer agent are null (or empty) or not part of the simulation containerantlr.SemanticException
- Will be thrown when the agent of interest has no neighbours within the social network (fraction is undefined)public static Product findBestProduct(java.util.Map<Product,java.lang.Integer> productImportanceMap) throws antlr.SemanticException
antlr.SemanticException
public static boolean findCommonOverwriteDecisionMakingProcessProducts(java.util.Set<Product> productsQualifyingForDecisison)
productsQualifyingForDecisison
- Products to be checked for a common overwrite decision processpublic static Product determineStandardProduct(java.util.Set<Product> consideredProducts, SimulationContainer simulationContainer) throws java.lang.IllegalArgumentException
consideredProducts
- The products whose standard product is to be derivedsimulationContainer
- The container the simulation runs injava.lang.IllegalArgumentException
- Will be thrown if products fall in several product groups, are not part of the simulation, or the container is nullpublic static java.util.Set<ProductGroup> deriveProductGroups(java.util.Set<Product> products) throws java.lang.IllegalArgumentException
products
- The products whose product groups are to be derivedjava.lang.IllegalArgumentException
- Will be thrown when set of products are emptypublic static java.util.ArrayList<Value> orderValuesByPreference(java.util.Set<Preference> preferences) throws java.lang.IllegalArgumentException
preferences
- The preferences to be orderedjava.lang.IllegalArgumentException
- Will be thrown when the preference set is emptypublic static java.util.Map<java.lang.Integer,java.util.Set<FixedProductDescription>> determineInitiallyAdoptedProducts(int numberOfConsumers, java.util.Map<FixedProductDescription,UnivariateDistribution> initialProductConfiguration) throws java.lang.IllegalArgumentException
numberOfConsumers
- The number of consumers to assign fixed products toinitialProductConfiguration
- A map of fixedProductDescriptions (representing products) and their distribution (representing how likely a consumer agent is to have the product adopted initially)java.lang.IllegalArgumentException
- Will be thrown when the number of consumers is non-positivepublic static int countNodes(java.util.HashMap<java.lang.Integer,java.util.Set<SNNode>> nodesByDegree)
nodesByDegree
- HashMap of the nodes to count and their degreepublic static ProductGroup findCommonProductGroup(java.util.Set<Product> potentialProducts) throws java.lang.IllegalArgumentException
potentialProducts
- The products whose product groups are to be derivedjava.lang.IllegalArgumentException
- Will be thrown when set of products are empty or don't share the same product grouppublic static ProductAttribute getInvestmentCostPA(Product product) throws java.lang.IllegalArgumentException
product
- The product from which investmentCost is extractedjava.lang.IllegalArgumentException
- Gets thrown when the product is null or doesnt containt the product attribute investmentCostpublic static ProductAttribute getCompatibilityPA(Product product) throws java.lang.IllegalArgumentException
product
- The product from which compatibility is extractedjava.lang.IllegalArgumentException
- Gets thrown when the product is null or doesnt containt the product attribute compatibilitypublic static java.util.Set<ProductAttribute> makeProductAttributesFromProductGroupAttributeValueMap(java.util.Map<ProductGroupAttribute,java.lang.Double> productGroupAttributeValueMap)
productGroupAttributeValueMap
- A map of PGAs and the values the resulting ProductAttributes should exhibitpublic static ConsumerAgentAdoptionDecisionProcess getEmployedDecisionProcess(ConsumerAgent consumerAgent, Product product)
consumerAgent
- agent to whose decision process this method defaultsproduct
- product that potentially overwrites the decision processpublic static java.util.List<Event> ScriptedEventToEvent(java.util.List<ScriptedProductEvent> scheduledProductEvents)
scheduledProductEvents
- The ScriptedProductEvents to cast to Eventspublic static AdoptedProduct getCorrespondingAdoptedProduct(java.util.Set<AdoptedProduct> adoptedProducts, Product respectiveProduct) throws java.lang.IllegalArgumentException
adoptedProducts
- The set of AdoptedProducts to find the product inrespectiveProduct
- The product the AdoptedProduct to find refers tojava.lang.IllegalArgumentException
- Will be thrown when the set of adoptedProducts doesn't contain any that corresponds to the respectiveProductpublic static boolean anyAdoptedProductRefersToProduct(java.util.Set<AdoptedProduct> adoptedProducts, Product correspondingProduct)
adoptedProducts
- The set of AdoptedProducts to check (corresponding) membership incorrespondingProduct
- The product the set membership of the corresponding AdoptedProduct is to be foundpublic static Information chooseRandomInformation(java.util.Set<Information> informationSet)
informationSet
- The set of information to choose a piece frompublic static ProductAttributeInformation chooseRandomProductAttributeInformation(java.util.Set<ProductAttributeInformation> informationSet)
informationSet
- The set of ProductAttributeInformation to choose a piece frompublic static java.util.Set<Need> getUnsatisfiedNeeds(ConsumerAgent consumerAgentConcerned)
consumerAgentConcerned
- The ConsumerAgent to derive the unsatisfied needs frompublic static java.util.List<Need> sortNeeds(java.util.Set<Need> needsToSatisfy, NeedDevelopmentScheme needDevelopmentScheme)
needsToSatisfy
- The needs to be included in the return listneedDevelopmentScheme
- The NeedDevelopmentScheme within which the Needs are to be sortedpublic static double getMinimum(java.util.Set<java.lang.Double> doubles)
public static double getMaximum(java.util.Set<java.lang.Double> doubles)
public static void detectDoubleEdges(java.util.Set<SNEdge> preliminaryEdgeSet, java.util.Set<SNNode> nodeSet)
public static java.util.Set<SNNode> pickNNodes(java.util.Set<SNNode> nodesToPick, int noNodesToPick) throws java.lang.IllegalArgumentException
nodesToPick
- The nodes to choose fromnoNodesToPick
- The number of nodes to chosejava.lang.IllegalArgumentException
- Will be thrown when the number of nodes to pick exceeds the number of nodes in the set to pick frompublic static java.lang.Integer chooseIntegerByDistribution(java.util.Map<java.lang.Integer,java.lang.Double> integerProbabilityMap)
integerProbabilityMap
- A map of values to choose and their probability to be chosenpublic static boolean existsEdge(java.util.Set<SNEdge> edgeSet, SNNode sourceNode, SNNode targetNode)
edgeSet
- The edges to check whether such an edge is contained alreadysourceNode
- The source of the edge to checktargetNode
- The target of the edge to check