|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulator_lib.SimulatorSource
public class SimulatorSource
The SimulatorSource class assists the TraceSimulator driver program in dynamic source selection based on user/file availability and trust values.
Nested Class Summary | |
---|---|
static class |
SimulatorSource.Strategy
The Strategy enumeration lists the source selection strategies. |
Constructor Summary | |
---|---|
SimulatorSource()
|
Method Summary | |
---|---|
static int |
pickSource(Network nw,
int cycle,
int recv,
int file,
SimulatorSource.Strategy strategy)
Decide the source for a transaction, given current Network status. |
static SimulatorSource.Strategy |
pickStrategy(User.Behavior model)
Given a user Behavior, return the source Strategy they should follow. |
private static int |
sourceBest(Network nw,
int cycle,
int recv,
int file)
Choose the best (most trusted) available source for a transaction. |
private static int |
sourceRandom(Network nw,
int cycle,
int recv,
int file)
Choose a random available source for a transaction. |
private static int |
sourceWorst(Network nw,
int cycle,
int recv,
int file)
Choose the worse (least trusted) available source for a transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimulatorSource()
Method Detail |
---|
public static SimulatorSource.Strategy pickStrategy(User.Behavior model)
model
- The behavior model of some User
public static int pickSource(Network nw, int cycle, int recv, int file, SimulatorSource.Strategy strategy)
nw
- Network in which the transaction will take placecycle
- The current cyclerecv
- Identifier of the user requesting the filefile
- Identifier of the file being requestedstrategy
- Source selection Strategy being employed
private static int sourceBest(Network nw, int cycle, int recv, int file)
nw
- Network in which transaction will take placecycle
- The current cyclerecv
- Identifier of the user requesting the filefile
- Identifier of the file being requested
private static int sourceWorst(Network nw, int cycle, int recv, int file)
nw
- Network in which transaction will take placecycle
- The current cyclerecv
- Identifier of the user requesting the filefile
- Identifier of the file being requested
private static int sourceRandom(Network nw, int cycle, int recv, int file)
nw
- Network in which transaction will take placecycle
- The current cyclerecv
- Identifier of the user requesting the filefile
- Identifier of the file being requested
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |