|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dbe.eve.simulator.SMERelationships
public class SMERelationships
SMERelationships stores a table with Relationships between SMEs Example: This table A B C A 0 1 0 B 1 0 1 C 0 1 0 is stored in the 3 vectors smeNames = {A, B, C} relationShips = {{0, 1, 0}, {1, 0, 1}, {0, 1, 0}}
| Nested Class Summary | |
|---|---|
private class |
SMERelationships.DijstraComparator
DijstraComparator is used by the findNewFriend method, as Java anonymous classes do not support closures and the distance array is needed for the comparison. |
| Field Summary | |
|---|---|
(package private) static org.apache.log4j.Logger |
logger
|
private double |
maxWeight
|
private java.util.Vector |
relationShips
|
private java.util.HashMap |
smeNames
|
| Constructor Summary | |
|---|---|
SMERelationships()
|
|
| Method Summary | |
|---|---|
void |
addRelationship(java.lang.String from,
java.lang.String to,
int value)
add a relationship to the table. |
int |
findNewFriend(int source,
int target)
Calculates the strenght of the connection between two companies that do not know each other. |
int |
getNumSMEs()
returns the number of smes |
java.util.Vector |
getRelationships()
returns the vector with the relationships |
int |
getSmeId(java.lang.String smeName)
return the id of a sme |
java.lang.String |
getSmeNameById(int id)
returns the name of a sme |
java.util.Vector |
getSMENames()
returns all sme names as a vector |
private int |
getWeight(int i,
int j)
Gets the strength of the connection between company i and company j |
java.lang.String |
toString()
Returns the relations ships as string |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static org.apache.log4j.Logger logger
private double maxWeight
private java.util.Vector relationShips
private java.util.HashMap smeNames
| Constructor Detail |
|---|
public SMERelationships()
| Method Detail |
|---|
public void addRelationship(java.lang.String from,
java.lang.String to,
int value)
from - the row nameto - the column namevalue - the strengthpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Vector getSMENames()
public java.util.Vector getRelationships()
public int getSmeId(java.lang.String smeName)
smeName - the name of the smepublic java.lang.String getSmeNameById(int id)
id - the id of the smepublic int getNumSMEs()
private final int getWeight(int i,
int j)
i - Company fromj - Company to
public int findNewFriend(int source,
int target)
source - Company fromtarget - Company to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||