EASE.Factories
Class Factory
java.lang.Object
|
+--java.lang.Thread
|
+--EASE.Factories.Factory
- Direct Known Subclasses:
- NumberFactory, VectorFactory
- public class Factory
- extends java.lang.Thread
- implements Constants
This is the class for a generic factory.
Fields inherited from class java.lang.Thread |
contextClassLoader,
daemon,
eetop,
group,
inheritedAccessControlContext,
initial_stack_memory,
MAX_PRIORITY,
MIN_PRIORITY,
name,
NORM_PRIORITY,
priority,
PrivateInfo,
single_step,
stillborn,
stopThreadPermission,
target,
threadInitNumber,
threadQ,
values |
Constructor Summary |
Factory(java.lang.String name,
java.lang.ThreadGroup group)
|
Factory(java.lang.String name,
java.lang.ThreadGroup group,
java.lang.Object defaultOutput)
|
Methods inherited from class java.lang.Thread |
,
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
exit,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
init,
interrupt,
interrupt0,
interrupted,
isAlive,
isDaemon,
isInterrupted,
isInterrupted,
join,
join,
join,
nextThreadNum,
registerNatives,
resume,
resume0,
setContextClassLoader,
setDaemon,
setName,
setPriority,
setPriority0,
sleep,
sleep,
start,
stop,
stop,
stop0,
suspend,
suspend0,
toString,
yield |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
asleep
public boolean asleep
reallyasleep
public boolean reallyasleep
listeners
private java.util.Vector listeners
engineers
private java.util.Vector engineers
noOfEngineers
private int noOfEngineers
name
protected java.lang.String name
nextProposed
protected java.lang.Object nextProposed
output
protected java.lang.Object output
defaultOutput
private java.lang.Object defaultOutput
debuggingOn
private boolean debuggingOn
debugger
protected Debugger debugger
paused
final java.lang.Double paused
Factory
public Factory(java.lang.String name,
java.lang.ThreadGroup group,
java.lang.Object defaultOutput)
Factory
public Factory(java.lang.String name,
java.lang.ThreadGroup group)
run
public void run()
- Overrides:
- run in class java.lang.Thread
reevaluateBest
private boolean reevaluateBest(java.util.Vector engineers,
java.lang.Object output,
double[] outputSatis,
int noEngineers)
calcSatis
private double calcSatis(double priority,
double satisfaction)
output
public java.lang.Object output()
- This is the function that the agent controller will call to
get the output from the thread. It should be known elsewhere?
how to interpret the object.
addEngineer
public void addEngineer(InstantiatedEngineer eng)
- Function to allow engineers to register their interest in the factory.
removeEngineer
public void removeEngineer(InstantiatedEngineer eng)
- Function to allow engineers to finish with the factory.
nextProposed
protected java.lang.Object nextProposed(java.lang.Object lastProposed)
- Function to come up with a new suggested value for the factory
output. Obviously this does nothing. Subclasses of factory should
do an interesting implementation.
swap
private void swap(double[] arr,
int i)
- Swap array element with next array element
safeSuspend
public void safeSuspend()
- Used to stop the factory safely
getRegisteredEngineers
public java.util.Vector getRegisteredEngineers()
addListener
public void addListener(NegotiationListener l)
removeListener
public void removeListener(NegotiationListener l)
getFactoryName
public java.lang.String getFactoryName()
setFactoryName
public void setFactoryName(java.lang.String name)
getDefaultOutput
protected java.lang.Object getDefaultOutput()