|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jswarm_pso.example_2.SwarmShow2D
public class SwarmShow2D
An extremely simple swarm optimization example Maximize function f( x1 , x2 ) = 1 - Sqrt( ( x1 - 3/4 )^2 + ( x2 - 1/4 )^2 ) Solution is (obviously): [ 3/4 , 1/4 ]
| Field Summary | |
|---|---|
(package private) int |
displayRefresh
Refresh display every 'displayRefresh' number of iterations |
(package private) DrawingArea |
drawingArea
Drawing area |
(package private) javax.swing.JFrame |
frame
Frame containing drawing area |
(package private) javax.swing.JLabel |
message
Message text |
(package private) int |
numberOfIterations
Number of iterations |
(package private) java.awt.Dimension |
preferredSize
Prefered drawing area's dimention |
(package private) int |
showDimention0
Dimentions to show in graph |
(package private) int |
showDimention1
Dimentions to show in graph |
(package private) boolean |
showVelocity
Show velocities in graph? |
(package private) Swarm |
swarm
Swarm optimizer |
| Constructor Summary | |
|---|---|
SwarmShow2D(Swarm swarm,
int numberOfIterations,
int displayRefresh,
boolean showVelocity)
Create a new SwarmShow2D Object |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Action dispatcher |
private void |
buildUserInterface(java.awt.Container container)
Builds User Interface |
void |
clear()
|
int |
getDisplayRefresh()
|
int |
getNumberOfIterations()
|
java.awt.Dimension |
getPreferredSize()
|
int |
getShowDimention0()
|
int |
getShowDimention1()
|
Swarm |
getSwarm()
|
boolean |
isShowVelocity()
|
void |
run()
Run swarm |
void |
setDisplayRefresh(int displayRefresh)
|
void |
setMessage(java.lang.String text)
|
void |
setNumberOfIterations(int numberOfIterations)
|
void |
setPreferredSize(java.awt.Dimension preferredSize)
|
void |
setShowDimention0(int showDimention0)
|
void |
setShowDimention1(int showDimention1)
|
void |
setShowVelocity(boolean showVelocity)
|
void |
setSwarm(Swarm swarm)
|
void |
showSwarm()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int displayRefresh
DrawingArea drawingArea
javax.swing.JFrame frame
javax.swing.JLabel message
int numberOfIterations
java.awt.Dimension preferredSize
int showDimention0
int showDimention1
boolean showVelocity
Swarm swarm
| Constructor Detail |
|---|
public SwarmShow2D(Swarm swarm,
int numberOfIterations,
int displayRefresh,
boolean showVelocity)
swarm - : Swram to optimizenumberOfIterations - : Number of iterationsdisplayRefresh - : Refresh display every N iterationsshowVelocity - : Show velocity lines| Method Detail |
|---|
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerprivate void buildUserInterface(java.awt.Container container)
container - public void clear()
public int getDisplayRefresh()
public int getNumberOfIterations()
public java.awt.Dimension getPreferredSize()
public int getShowDimention0()
public int getShowDimention1()
public Swarm getSwarm()
public boolean isShowVelocity()
public void run()
run in interface java.lang.Runnablepublic void setDisplayRefresh(int displayRefresh)
public void setMessage(java.lang.String text)
public void setNumberOfIterations(int numberOfIterations)
public void setPreferredSize(java.awt.Dimension preferredSize)
public void setShowDimention0(int showDimention0)
public void setShowDimention1(int showDimention1)
public void setShowVelocity(boolean showVelocity)
public void setSwarm(Swarm swarm)
public void showSwarm()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||