Flocking Canvas->Polygons |
||||||||||||||||||||||||||||||||||||
TO DO:
|
TO DO:
|
|||||||||||||||||||||||||||||||||||
Nice models I & 2 (Hal Levison, Southwest Research Institute, Boulder, Colorado). Sky & Telescops. | Kirkwood Gaps (based on a plot by Alan Chamberlain, JPL/Caltech, California posted on Wikipedia). | Jupiter Trojan (red & green) and Hilda (white) family of asteroids (Pulkovo Astronomical Observatory, Russian Academy of Sciences, St. Petersburgh. | Horseshoe orbits and the 5 Lagrage points (Xander talk 1989, NASA). | |||||||||||||||||||||||||||||||||
Data set for the above four screen shots: Jupiter 6548231.txt |
XE6 - Flocking / Orbits -
Version 40 - Nick Gessler - 7 October 2016 Improvements:
Some orbital resonances to explore (AU values are entered as thousandths):
Important variables and functions (line numbers may differ from the present version). |
|||||||||||||||||||||||||||||||||||
XE6 - Flocking / Orbits -
Version 37 - Nick Gessler - 20 October 2015 Improvements:
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
XE6 - Flocking / Orbits -
Version 35 - Nick Gessler - 18 March 2015 The control panel has been enlarged and slightly modified.
A Measure Radius feature (the twohorizontal white lines) has been added for confirming circular orbits. |
||||||||||||||||||||||||||||||||||||
Flocking / Orbits -
Version 34 - Nick Gessler - 2 April 2014 A new "Auto Run" function has been implemented. |
||||||||||||||||||||||||||||||||||||
Flocking / Orbits -
Version 33 - Nick Gessler - 26 March 2014 When "Space" is set to "Evolving," the number of new asteroids thrown in is also counted. The orbiting rules have been renumbered and a modification has been made to the orbits in the You can now "Launch" asteroieds from Mars, from Jupiter and from multiple points along the radius. The "Launch Asteroids" velocity is presently fixed.
Ideally, for a given gravity, we would like the launch velocities that give perfect circular orbits at different radii For the data from a four-hour run click here. |
||||||||||||||||||||||||||||||||||||
Flocking / Orbits -
Version 32 - Nick Gessler - 18 November 2013 For the data from a four-hour run click here. |
||||||||||||||||||||||||||||||||||||
Flocking / Orbits -
Version 31 - Nick Gessler - 11 November 2013 For a clear view of the composite (without the control panel) click here. For the data from a four-hour run click here.
|
||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
Flocking / Orbits -
Version 30 - Nick Gessler - 1 November 2013 Flocking / Orbits -
Version 29 - Nick Gessler - 7 November 2013 |
||||||||||||||||||||||||||||||||||||
Flocking Polygons - Orbits Around Three Massive Objects A third gravitating body has been added and the POV changed to show the revolution around the main massive object (i.e. Sun). The gravitational attraction of the Sun and planets are different. To do: Only some of the "sweet spots" in the code. |
||||||||||||||||||||||||||||||||||||
Flocking Polygons - Orbits Around Three Massive Objects A third gravitating body has been added and the POV changed to show the revolution around the main massive object (i.e. Sun). Only some of the "sweet spots" in the code. |
||||||||||||||||||||||||||||||||||||
Flocking Polygons - Orbits Around Two Massive Objects Two gravitating bodies influence the orbits of asteroids. The POV has been fixed to hold the positions of those main masses (i.e. Suns) constant. Trails persist but they can be colored to show the position of each asteroid at each iteration. The color TrackBar can expand the color mapping significantly. Rule #18 has been added to simulate orbits around two massive objects. It works very much like rule #12. The speed of a planetesimal will increase as it approaches the Sun. "Randomize All" will start a new simulation, so pressing this a number of times will show you the range of variation of orbits one might expect to see. Note that the planetesimal agents are given random speeds and directions so that only a few of them will produce ellipses within the display area. Note too that occasionally and orbiting body traces a knot-like path around the Sun. The dynamics are qualitatively correct. However, because of the precision limits of a long double, objects which pass the massive objects in close encounters will be purturbed in their orbits.
|
||||||||||||||||||||||||||||||||||||
Gallery (click on image to enlarge) Settings: Set "Population" to large Vary "Independence" while the simulation is running Set "Color Range" to maximum, Click "Reset" Press "Assign Next" Press "Equalize Speed" Set "Space" to infinite although the pattern may wander off the screen. Other settings have interesting effects Set "Agent Shape" to line Set "Agent Color" to iterations color synchronous |
||||||||||||||||||||||||||||||||||||
Flocking Orbits - Version 23c - 27 March 2013 If you click on rule #12, many of the settings will be automatically chosen in order to optimize the visualization. The speed of a planetesimal will increase as it approaches the Sun. "Randomize All" will start a new simulation, so pressing this a number of times will show you the range of variation of orbits one might expect to see. Note that the planetesimal agents are given random speeds and directions so that only a few of them will produce ellipses within the display area. Note too that occasionally and orbiting body traces a knot-like path around the Sun. The Celestial Mechanics formula is correct and the source code implements it. The question is this: Are the wandering ellipses, the rosettes and the rare tangled orbits realistic? That is to say, do they occur in real life in nature? If not, they may be artifacts of the inprecision of the variables in the calculations. The faster an object moves, the less precisely its position is calculated. Consequently, each close pass by the Sun may introduce an incremental error which would cause the ellipse to rotate. In fact it appears that the closer the orbit passes the Sun, the more the ellipse wanders. On the other hand, calculating positions more precisely should reduce the problem if it is an "artifact." When the "Sim Delay" TrackBar is pushed to the extremem left, the pattern of wanderings does not change. That would seem to argue that the wandering is not an artifact.. We might might minimize this problem by letting the Sun "consume" anything that passes close by. Adding more gravitational bodies if these are "artifacts" of the simulation and we keep them as little as possible, resonances should over-shadow them.
|
||||||||||||||||||||||||||||||||||||
Flocking - Version 23b - 26 March 2013 A new rule #12 has been added to simulate the gravitational attraction of planetoid agents to the Sun at the center of the screen. When rule #12 is selected, other parameters are set to optimize the visualization. As a shortcut to adjusting the acceleration due to gravity and the mass of the Sun, the "Independence" TrackBar is automatically changed to read "Gravitation." Because no collisions with the Sun are detected, objects which would otherwise crash into the Sun and be absorbed instead pass close by and reach enormous speeds. Consequently, collisions should be implemented. A new square shape for drawing planetoid agents, independent of their speed, has been added for a less confusing visualization. A new visualization has been added to color each planetoi agent by the colorRamp() equivalent of its tag number. A new "infinite" spatial representation has been implemented. The orbits appear to be accurate...
|
||||||||||||||||||||||||||||||||||||
Flocking - Version 22b - 13 November 2012 - Nick Gessler Rule 6 "Follow Assigned Individual" now handles several options for who to follow. Who an agent should follow may be set in the "Assign Agents to Follow" control. The "leading" agent may, or may not, follow the cursor. The wandering loop structure illustrated to the left is the result of a low population (e.g. 40), a high independence (e.g. 700) and a visualization NOT based upon speed. "Reset" randomizes almost everything, so any time you press "Reset" or change the "Population" you must then press "Assign Agents to Follow / Next" and "Equalize Speed." Setting the "Space" to "Bounce" eliminates much of the jarring interruptions when an agent goes out-of-bounds. A rule approximating gravitation has been added. In what ways does it succeed? In what ways does it fail? The force of gravitation is calculated as a variable (set by "Radius") divided by the distance squared. That force is applied as a velocity applied in the direction of the cursor. The complex global patterns of movement arise from the individual behaviors of up to 700 individuals, mostly following the same local rules of behavior. Agents begin with random speeds and directions and interact with other agents they can see. The agents’ perceptual radius, independence, variability and other parameters may be adjusted. A variety of visualizations and sonifications are possible. The simulation may be run manually from the gray control panel or automatically by selecting “timers-on,” which will change settings at random intervals. Right-click the display to recover the manual controls. To do: Create a society, a culture, of heterogeneous agents acting at cross-purposes to encourage the emergence of competition and cooperation...
|
||||||||||||||||||||||||||||||||||||
Flocking - Version 22a - 8 November 2012 - Nick Gessler A rule approximating gravitation has been added. In what ways does it succeed? In what ways does it fail? The force of gravitation is calculated as a variable (set by "Radius") divided by the distance squared. That force is applied as a velocity applied in the direction of the cursor. The rules, function names and variable names have been simplified. The complex global patterns of movement arise from the individual behaviors of up to 700 individuals, mostly following the same local rules of behavior. Agents begin with random speeds and directions and interact with other agents they can see. The agents’ perceptual radius, independence, variability and other parameters may be adjusted. A variety of visualizations and sonifications are possible. The simulation may be run manually from the gray control panel or automatically by selecting “timers-on,” which will change settings at random intervals. Right-click the display to recover the manual controls. To do: Create a society, a culture, of heterogeneous agents acting at cross-purposes to encourage the emergence of competition and cooperation... |
||||||||||||||||||||||||||||||||||||
Flocking - Version 22 - 5 November 2012 - Nick Gessler The rules, function names and variable names have been simplified. The complex global patterns of movement arise from the individual behaviors of up to 700 individuals, mostly following the same local rules of behavior. Agents begin with random speeds and directions and interact with other agents they can see. The agents’ perceptual radius, independence, variability and other parameters may be adjusted. A variety of visualizations and sonifications are possible. The simulation may be run manually from the gray control panel or automatically by selecting “timers-on,” which will change settings at random intervals. Right-click the display to recover the manual controls. To do: Create a society, a culture, of heterogeneous agents acting at cross-purposes to encourage the emergence of competition and cooperation... Only the "sweet spots" in the code. |
||||||||||||||||||||||||||||||||||||
Flocking - Version 21 - 27 March 2012 - Nick Gessler The complex global patterns of movement in this simulation arise from the individual behaviors of up to 700 individuals, all following the same local rule of behavior. Agents begin with random speeds and directions and interact with other agents they can see. The agents’ sight radius, independence and variability may be set with sliders. A suite of visualizations and sonifications is available. The simulation may be run manually from the gray control panel or automatically by selecting “timers-on,” which will change settings at random intervals. Right-click the display to recover the manual controls. Except for their speed and direction, all agents share a homogeneous set of cognitions and actions. To do: Create a society, a culture, of heterogeneous agents acting at cross-purposes to encourage the emergence of competition and cooperation... Only the "sweet spots" in the code. |
||||||||||||||||||||||||||||||||||||
Flocking - Version 20 - 8 January 2012 - Nick Gessler The complex global patterns of movement in this simulation arise from the individual behaviors of up to 700 individuals, all following the same local rule of behavior. Agents begin with random speeds and directions and interact with other agents they can see. The agents’ sight radius, independence and variability may be set with sliders. A suite of visualizations and sonifications is available. The simulation may be run manually from the gray control panel or automatically by selecting “timers-on,” which will change settings at random intervals. Right-click the display to recover the manual controls. Except for their speed and direction, all agents share a homogeneous set of cognitions and actions. Coming soon: a society of heterogeneous agents forming even more interesting self-organization. |
||||||||||||||||||||||||||||||||||||
A to-do list for Flocking:
|
|
|||||||||||||||||||||||||||||||||||
Flocking - Version 17 - AutoRun and FullScreen - 14 November 2011 |
||||||||||||||||||||||||||||||||||||
Flocking - Version 14 - AutoRun and FullScreen - 8 November 2011 |
||||||||||||||||||||||||||||||||||||
Canvas->Polygon Agents - Version 13 - AutoRun and FullScreen |
||||||||||||||||||||||||||||||||||||
Canvas->Polygon Agents - Version 12 - AutoRun and FullScreen |
||||||||||||||||||||||||||||||||||||
Canvas->Polygon Agents - Version 11 - AutoRun and FullScreen |
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||
Canvas->Polygon Agents - Version 10 - Full Screen - Multiple Timers |
||||||||||||||||||||||||||||||||||||
Canvas->Polygon Agents - Versions 7 & 8 Variable and function names have been made more intuitive. Coloring has been improved. Trails may be displayed without the Pen->Color = clBlack;. Agents may be colored by their speed, location or number of neighbors in their perceptual radius. TrackBars for Perceptual Radius, Independence and Variance. Rules include Nearest Neighbor, Weighted Neighbors within a Radius and Follow the Moving or Fixed Cursor. Left-click to "fix" or "unfix" the cursor position as the target. Try this: Set color to speed; set rule to follow; set independence to high. Stir up the agents by leading them with a large circular motion of the mouse. Once the agents are in sync, quickly fix the cursor target in the center of the paintbox with a left-click. Now you can use the Mouse to adjust the other parameters. Try this: Set color to speed; set rule to follow and fix the cursor target in the center. Slide independence trackbar to 0 until all agents are churning nicely at the center, then quickly slide it to maximum. Watch the oscillations which will become more subtle you press Reset.
|
||||||||||||||||||||||||||||||||||||
Canvas->Polygon Agents - Version 5 The agents are represented as Canvas->Polygons pointing in the direction of travel and with sizes based upon their speed. Instead of velocities, agents are given the distance they travel per timestep in the X direction (dX) and in the Y direction (dY). Three options for coloring are included. Two functions for agent interaction are included. What functionality must you add to give the agents more realistic behavior? |
||||||||||||||||||||||||||||||||||||
Canvas->Rectangle Agents - Versions 2 and 3 Wandering squares is an attempt to add more power to the simulation, to make it run faster and with more agents. It takes many more computer cycles to move TImages around. In contrast, drawing squares on the canvas and erasing them is orders of magnitude faster. In fact, drawing a square is ten times faster than drawing circles. Additionally, instead of the velocities and directions given to agents in the "Flocking" series, which need to be reduced to their components with each time step, the "Wandering Squares" series simply uses the change in the x and y directions, dX and dY in the code, as the steps each agent will use per time step. This is a demonstration version, which will run smoothly if you don't change the size of the squares. Feel free to add code to give agents more realistic behavior... |
||||||||||||||||||||||||||||||||||||
Version - 2 - 21 October 2009 |
Version - 3 (new and improved) - 26 October 2009 |
|||||||||||||||||||||||||||||||||||
2000 Wandering Squares - Version 1 Wandering squares is an attempt to add more power to the simulation, to make it run faster and with more agents. It takes many more computer cycles to move TImages around. In contrast, drawing squares on the canvas and erasing them is orders of magnitude faster. In fact, drawing a square is ten times faster than drawing circles. Additionally, instead of the velocities and directions given to agents in the "Flocking" series, which need to be reduced to their components with each time step, the "Wandering Squares" series simply uses the change in the x and y directions, dX and dY in the code, as the steps each agent will use per time step. Almost all the activity of this simulation has been written into the class structure. Also, in contrast to the flocking simulations below which use TImage or TShape objects, the agents in this simulation use Canvas draw commands. Interestingly, Canvas->Rectangle() executes about ten times faster than Canvas->Ellipse() which allows for a huge number of agent visualizations. This is not surprising since a circle is composed of many more line segments than a square. |
||||||||||||||||||||||||||||||||||||
Nicholas Mei's Flocking - 2008 |
||||||||||||||||||||||||||||||||||||
Michael Chang's Aquarius |
||||||||||||||||||||||||||||||||||||
Michael Chang's Evolva |
|
|||||||||||||||||||||||||||||||||||
Michael Chang's Transitional Lines |
|
|||||||||||||||||||||||||||||||||||
Bob and Carol and Ted and Alice |
||||||||||||||||||||||||||||||||||||
Attraction & Avoidance |