|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.engine.SimModelImpl
uchicago.src.sim.engine.SimpleModel
org.dbe.eve.simulator.EvEModel
public class EvEModel
Represents the EvE Model as a Repast model
| Field Summary | |
|---|---|
private LocalServicePool |
centralServicePool
|
private int |
distanceSME
|
private uchicago.src.sim.analysis.Plot |
fitnessPlot
|
private uchicago.src.sim.gui.AbstractGraphLayout |
graphLayout
|
private float |
growthFactor
|
private static EvEModel |
instance
|
private boolean |
isRunning
|
private boolean |
loadedModel
|
(package private) static org.apache.log4j.Logger |
logger
|
private float |
migrationRate
|
(package private) static MersenneTwister |
mt
|
private float |
mutationFactor
|
private int |
nextServiceID
|
private int |
nextSMEID
|
private int |
numAttributes
|
private int |
numAttributesMax
|
private int |
numAttributesMin
|
private int |
numDemandedServicesMax
|
private int |
numDemandedServicesMin
|
private int |
numOfSMEPerGroup
|
private int |
numServices
|
private int |
numSMEs
|
private int |
numUselessHops
|
private java.lang.String |
saveFitnessDataPath
|
private java.lang.String |
saveModelPath
|
private java.lang.String |
saveSmeInteractionPath
|
private boolean |
servicePoolExchange
|
private float |
servicePoolExchangeFactor
|
private SettingsFrame |
sf
|
private boolean |
showComparisonGraph
|
private boolean |
shrinkByAge
|
private boolean |
shrinkByProfile
|
private boolean |
shrinkByUseage
|
private float |
shrinkFactor
|
private float |
sMEequalityFactor
|
private boolean |
sMEgrouping
|
private int |
sMEGroups
|
private int |
speedFactor
|
private int |
step
|
private int |
stepsToEnd
|
private uchicago.src.sim.gui.DisplaySurface |
surface
|
private java.awt.Color |
surfaceColor
|
(package private) uchicago.src.sim.gui.TextDisplay |
td
|
private boolean |
useCentralServicePool
|
private boolean |
useFitnessPlot
|
private boolean |
useNetworkEdges
|
private boolean |
usePartnerEdges
|
private boolean |
useProducerEdges
|
private int |
worldXSize
|
private int |
worldYSize
|
| Fields inherited from class uchicago.src.sim.engine.SimpleModel |
|---|
agentList, autoStep, isGui, name, params, schedule, seed, shuffle, startAt |
| Fields inherited from class uchicago.src.sim.engine.SimModelImpl |
|---|
descriptors, modelManipulator |
| Constructor Summary | |
|---|---|
private |
EvEModel()
The EvEModel constructur. |
| Method Summary | |
|---|---|
SME |
addSME(int id,
int color,
int x,
int y)
creates a new SME and adds it to the agetnList of the model |
SME |
addSME(int id,
java.lang.String name,
int color)
creates a new SME and adds it to the agentList of the model |
SME |
addSMEbyFact()
Creates a SME using the factory. |
SME |
addSMEbyFact(int prototypid)
Creates a SME using the factory. |
SME |
addSMEperGroupByFact(int groupid,
int prototypid)
Creates a SME using the factory. |
void |
atEnd()
this method is executed at the end of the simulation |
void |
begin()
this method is executed after start button |
void |
buildDisplay()
builds the repast display |
void |
buildModel()
the buildModel method initials the model. |
void |
buildSchedule()
the buildSchedule method defines when the methods have to run |
private void |
distributeOnOfferServices()
this methode is used to create, out of the DemandedService of a group, service which will be distributed to all other clusters except the group which have stored the DemandedServices |
void |
drawFitnessPlotPoint()
draws the fitness plot |
private void |
exchangeLocalServicePool(SME sMEa,
SME sMEb)
Adds Service of other SMEs to an target SME. |
void |
exchangeLocalServicePools(SME sme)
this methode exchange servicePools |
java.util.ArrayList |
getAgentList()
Returns the list of smes |
LocalServicePool |
getCentralServicePool()
|
int |
getDistanceSME()
|
float |
getGrowthFactor()
|
static EvEModel |
getInstance()
Singelton to ensure that only one Instance exsist |
float |
getMigrationRate()
|
float |
getMutationFactor()
|
double |
getNetworkFitness()
calculates the fitness of the hole network |
int |
getNextServiceID()
return and increase the id for the next service |
int |
getNextSMEID()
return and increase the id for the next sme |
int |
getNumAttributes()
|
int |
getNumAttributesMax()
|
int |
getNumAttributesMin()
|
int |
getNumDemandedServicesMax()
|
int |
getNumDemandedServicesMin()
|
int |
getNumOfSMEPerGroup()
|
int |
getNumServices()
|
int |
getNumSMEs()
|
int |
getNumUselessHops()
|
private SME |
getRandomAgent()
returns an SMEs ehich is choosen randomly. |
private java.util.Vector |
getRandomAgents(int numOfAgents,
SME initiatorSME)
returns an Vector of SMEs the SMEs in the Vector are choosen randomly. |
java.lang.String |
getSaveFitnessDataPath()
|
java.lang.String |
getSaveModelPath()
|
java.lang.String |
getSaveSmeInteractionPath()
|
boolean |
getServicePoolExchange()
|
float |
getServicePoolExchangeFactor()
|
boolean |
getShowComparisonGraph()
|
boolean |
getShrinkByAge()
|
boolean |
getShrinkByProfile()
|
boolean |
getShrinkByUseage()
|
float |
getShrinkFactor()
|
SME |
getSMEbyId(int id)
returns SME by id |
float |
getSMEequalityFactor()
|
boolean |
getSMEgrouping()
|
int |
getSMEGroups()
|
private java.lang.String |
getSMEInteractionsAsString()
return the SMEInteraction as an String |
int |
getSpeedFactor()
|
int |
getStep()
|
int |
getStepsToEnd()
|
boolean |
getUseCentralServicePool()
|
private java.lang.String |
getUsedServiceHistoryAsString()
return the Histroy of the all UsedService of all SMEs as an String |
boolean |
getUseFitnessPlot()
|
boolean |
getUseNetworkEdges()
|
boolean |
getUsePartnerEdges()
|
boolean |
getUseProducerEdges()
|
int |
getWorldXSize()
|
int |
getWorldYSize()
|
private void |
instanciateFitnessPlot()
instanciate the fitness plot |
boolean |
isRunning()
|
void |
loadModel(java.lang.String type)
load the model from a file |
void |
migrateService(Service service,
SME fromSME)
Migrates a service from the given SME by the migration probability of the Service |
private java.util.Vector |
networkLookup(SME initiatorSME)
|
void |
restartModel()
|
private void |
saveSMEInteractionIntoFile()
write the sme interaction data into the file network.csv |
void |
setDistanceSME(int val)
|
void |
setGrowthFactor(float growthFactor)
|
void |
setLoadedModel(boolean loadedModel)
|
void |
setMigrationRate(float val)
|
void |
setMutationFactor(float mutationFactor)
|
void |
setNumAttributes(int val)
|
void |
setNumAttributesMax(int val)
|
void |
setNumAttributesMin(int val)
|
void |
setNumDemandedServicesMax(int val)
|
void |
setNumDemandedServicesMin(int val)
|
void |
setNumOfSMEPerGroup(int val)
|
void |
setNumServices(int val)
|
void |
setNumSMEs(int val)
|
void |
setNumUselessHops(int val)
|
void |
setSaveFitnessDataPath(java.lang.String val)
|
void |
setSaveModelPath(java.lang.String val)
|
void |
setSaveSmeInteractionPath(java.lang.String val)
|
void |
setServicePoolExchange(boolean val)
|
void |
setServicePoolExchangeFactor(float servicePoolExchangeFactor)
|
void |
setShowComparisonGraph(boolean value)
|
void |
setShrinkByAge(boolean val)
|
void |
setShrinkByProfile(boolean val)
|
void |
setShrinkByUseage(boolean val)
|
void |
setShrinkFactor(float val)
|
void |
setSMEequalityFactor(float val)
|
void |
setSMEgrouping(boolean val)
|
void |
setSMEGroups(int val)
|
void |
setSpeedFactor(int speedFactor)
|
void |
setStepsToEnd(int stepsToEnd)
|
void |
setup()
The setup method. |
void |
setupModelSimulation()
setup new simulation |
void |
setUseCentralServicePool(boolean value)
|
void |
setUseFitnessPlot(boolean val)
|
void |
setUseNetworkEdges(boolean val)
|
void |
setUsePartnerEdges(boolean val)
|
void |
setUseProducerEdges(boolean val)
|
void |
setWorldXSize(int val)
|
void |
setWorldYSize(int val)
|
void |
shrinkServicePools()
call a shrink mechanism |
void |
step()
this happens every step |
void |
stopModelSimulation()
stop the Simulation |
void |
useGA()
start one GA for a randomly chosen SME. scheduled in buildSchedule() |
| Methods inherited from class uchicago.src.sim.engine.SimpleModel |
|---|
atPause, getInitParam, getName, getNextDoubleFromTo, getNextIntFromTo, getSchedule, postStep, preStep, run, runAutoStep, setRngSeed, setStoppingTime, setStoppingTime |
| Methods inherited from class uchicago.src.sim.engine.SimModelImpl |
|---|
addPropertyListener, addSimEventListener, clearMediaProducers, clearPropertyListeners, fireBooleanPropertyEvent, fireEndSim, fireNumericPropertyEvent, fireObjectPropertyEvent, firePauseSim, fireSimEvent, fireStopSim, fireStringPropertyEvent, generateNewSeed, getController, getMediaProducers, getModelManipulator, getParameterDescriptors, getPropertiesValues, getRngSeed, getTickCount, pause, registerDisplaySurface, registerMediaProducer, removePropertyListener, removeSimEventListener, setController, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static EvEModel instance
private java.awt.Color surfaceColor
private boolean isRunning
private int step
private int speedFactor
private int numOfSMEPerGroup
private float growthFactor
private float mutationFactor
private float servicePoolExchangeFactor
private int numSMEs
private int numServices
private int numDemandedServicesMin
private int numDemandedServicesMax
private float migrationRate
private boolean useProducerEdges
private boolean usePartnerEdges
private boolean useNetworkEdges
private int numAttributesMin
private int numAttributesMax
private int numAttributes
private int numUselessHops
private int worldXSize
private int worldYSize
private int distanceSME
private int stepsToEnd
private boolean useCentralServicePool
private boolean loadedModel
private boolean useFitnessPlot
private boolean servicePoolExchange
private boolean shrinkByProfile
private boolean shrinkByUseage
private boolean shrinkByAge
private boolean sMEgrouping
private float shrinkFactor
private float sMEequalityFactor
private int nextSMEID
private int nextServiceID
private java.lang.String saveModelPath
private java.lang.String saveSmeInteractionPath
private java.lang.String saveFitnessDataPath
private boolean showComparisonGraph
private LocalServicePool centralServicePool
private uchicago.src.sim.gui.AbstractGraphLayout graphLayout
private uchicago.src.sim.gui.DisplaySurface surface
private SettingsFrame sf
private uchicago.src.sim.analysis.Plot fitnessPlot
private int sMEGroups
static MersenneTwister mt
static org.apache.log4j.Logger logger
uchicago.src.sim.gui.TextDisplay td
| Constructor Detail |
|---|
private EvEModel()
| Method Detail |
|---|
public static EvEModel getInstance()
public void setup()
setup in interface uchicago.src.sim.engine.SimModelsetup in class uchicago.src.sim.engine.SimpleModelpublic void buildModel()
buildModel in class uchicago.src.sim.engine.SimpleModel
public SME addSME(int id,
java.lang.String name,
int color)
id - the id of the SMEcolor - the color of the SMEname - the name of the SME
public SME addSME(int id,
int color,
int x,
int y)
id - the id of the SMEcolor - the color of the SMEx - the x positiony - the y position
public SME addSMEbyFact()
public SME addSMEbyFact(int prototypid)
prototypid -
public SME addSMEperGroupByFact(int groupid,
int prototypid)
private void distributeOnOfferServices()
public void drawFitnessPlotPoint()
private void instanciateFitnessPlot()
public void restartModel()
public void stopModelSimulation()
public void setupModelSimulation()
public java.util.ArrayList getAgentList()
public void shrinkServicePools()
private java.lang.String getSMEInteractionsAsString()
private java.lang.String getUsedServiceHistoryAsString()
private void saveSMEInteractionIntoFile()
public void exchangeLocalServicePools(SME sme)
initiatorSME -
private void exchangeLocalServicePool(SME sMEa,
SME sMEb)
rndAgents - vector of SMEstargetSME - the SME which will get all Services of the SME of the
rndAgents vectorpublic void buildDisplay()
public void step()
step in class uchicago.src.sim.engine.SimpleModel
public void migrateService(Service service,
SME fromSME)
_service - _sme - public void atEnd()
atEnd in class uchicago.src.sim.engine.SimpleModelpublic void loadModel(java.lang.String type)
public void useGA()
private java.util.Vector getRandomAgents(int numOfAgents,
SME initiatorSME)
numOfAgents - the number of Agents of which the Vector should consist
private SME getRandomAgent()
private java.util.Vector networkLookup(SME initiatorSME)
public void begin()
begin in interface uchicago.src.sim.engine.SimModelbegin in class uchicago.src.sim.engine.SimpleModelpublic void buildSchedule()
buildSchedule in class uchicago.src.sim.engine.SimpleModelpublic SME getSMEbyId(int id)
id - id of SMEpublic double getNetworkFitness()
public int getNextServiceID()
public int getNextSMEID()
public void setNumSMEs(int val)
public int getNumSMEs()
public void setNumServices(int val)
public int getNumServices()
public void setNumDemandedServicesMin(int val)
public int getNumDemandedServicesMin()
public void setServicePoolExchange(boolean val)
public boolean getServicePoolExchange()
public void setNumDemandedServicesMax(int val)
public int getNumDemandedServicesMax()
public void setNumAttributesMin(int val)
public int getNumAttributesMin()
public void setNumAttributesMax(int val)
public int getNumAttributesMax()
public void setNumAttributes(int val)
public int getNumAttributes()
public void setNumUselessHops(int val)
public int getNumUselessHops()
public void setWorldXSize(int val)
public int getWorldXSize()
public void setWorldYSize(int val)
public int getWorldYSize()
public void setDistanceSME(int val)
public int getDistanceSME()
public float getGrowthFactor()
public void setGrowthFactor(float growthFactor)
public int getSpeedFactor()
public void setSpeedFactor(int speedFactor)
public void setStepsToEnd(int stepsToEnd)
public int getStepsToEnd()
public boolean getShrinkByProfile()
public void setShrinkByProfile(boolean val)
public boolean getShrinkByUseage()
public void setShrinkByUseage(boolean val)
public boolean getShrinkByAge()
public void setShrinkByAge(boolean val)
public float getServicePoolExchangeFactor()
public void setServicePoolExchangeFactor(float servicePoolExchangeFactor)
public float getMutationFactor()
public void setMutationFactor(float mutationFactor)
public boolean isRunning()
public void setLoadedModel(boolean loadedModel)
public void setShowComparisonGraph(boolean value)
public boolean getShowComparisonGraph()
public void setUseCentralServicePool(boolean value)
public boolean getUseCentralServicePool()
public void setShrinkFactor(float val)
public float getShrinkFactor()
public void setSMEGroups(int val)
public int getSMEGroups()
public int getNumOfSMEPerGroup()
public void setNumOfSMEPerGroup(int val)
public float getSMEequalityFactor()
public void setSMEequalityFactor(float val)
public boolean getSMEgrouping()
public void setSMEgrouping(boolean val)
public float getMigrationRate()
public void setMigrationRate(float val)
public boolean getUseFitnessPlot()
public void setUseFitnessPlot(boolean val)
public int getStep()
public boolean getUseProducerEdges()
public void setUseProducerEdges(boolean val)
public boolean getUsePartnerEdges()
public void setUsePartnerEdges(boolean val)
public boolean getUseNetworkEdges()
public void setUseNetworkEdges(boolean val)
public LocalServicePool getCentralServicePool()
public java.lang.String getSaveModelPath()
public void setSaveModelPath(java.lang.String val)
public java.lang.String getSaveFitnessDataPath()
public void setSaveFitnessDataPath(java.lang.String val)
public java.lang.String getSaveSmeInteractionPath()
public void setSaveSmeInteractionPath(java.lang.String val)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||