Group Abstract Group Abstract

Message Boards Message Boards

"Mathematica" Study Group for the "Complexity Explorer" online courses

I've just enrolled to "Introduction to Complexity (Fall, 2013)", a free online course that is part of a promising educational platform called the Complexity Explorer:
"Complexity Explorer is a web-based repository of educational materials related to complex systems science. Currently under development by researchers and educators at the Santa Fe Institute and Portland State University, Complexity Explorer will host SFI’s online courses, as well as an extensive complex systems glossary and easily searchable databases of syllabi, citations, and other resources related to complex systems topics. Complexity Explorer will also host a “Virtual Laboratory” consisting of open-source simulation programs illustrating complex systems ideas, theories, and tools, accompanied by curricula designed for both teachers and independent learners who want to take advantage of these simulations. All content of the Complexity Explorer website will be open to anyone."

I think that it would be great to feature, and even create, demonstrations relevant to this course. The given computational examples for  this course are in NetLogo which has a MathematicaLink integrated on it. But I would like to see what "Wolfram Community" is capable of. For example, the discussion started by Simon Woods a few weeks ago ended up creating a swarm dynamics explorer in Mathematica.

The course "Introduction to Complexity" has just started, so I encourage you to enroll, share ideas and participate in this unique educational experience.
1 year ago
Hola Bernat, Signed up for the training course. Let's see how much we can port to Mathematica.
POSTED BY: Diego Zviovich
1 year ago
Great Diego emoticon
I found the following interesting demonstrations regarding to the first provided ant examples:
  1. Food Searching Model for Ants
  2. Garbage Collection by Ants
  3. Ant Colony Optimization (ACO)
1 year ago
Hi Bernat, I was looking into the examples yesterday, but wanted something more along the lines of the standard ant colony optimization

So I started playing with the concepts, just trying ants walking randomnly without update on the pherormone field. Just setting up n number of ants and letting them walk.

Using the model of the confetti found here
I came up with the following piece of code.
 ymax = 1000; xmax = 1000;
 nest = {500, 500};
 maxAnts = 30;
 steps = 200;
 maxSpeed = 20;
 maxAngle = \[Pi]/6;
 orientation =
   RandomVariate[UniformDistribution[{0, 2 \[Pi]}], maxAnts];
ant = Table[
   agent[\[Infinity], nest, orientation[[i]], #] & /@ Range[i], {i,

update[agent[symbol_, location_, direction_, t_]] :=
Module[{dir, speed, loc},
  dir = First@
     UniformDistribution[{direction - maxAngle,
       direction + maxAngle}], 1];
  speed = RandomVariate[UniformDistribution[{1, maxSpeed}], 1];
  loc = Flatten[location + Round[{speed*Cos[dir], speed*Sin[dir]}]];
  loc = Min[#] & /@ Transpose[{loc, {xmax, ymax}}];
  loc = Max[#] & /@ Transpose[{loc, {0, 0}}];
  agent[symbol, loc, dir, t + 1]]

display[agent[symbol_, location_, direction_, t_]] :=
Text[Rotate[symbol, direction], location]
display[list_] := Module[{lst = display[#] & /@ list}, Graphics[lst]]

history =
     NestList[update, Last@ant[[#]], steps - Length[ant[[#]]]]] & /@

Animate[Show[Graphics[display[history[[All, i]]]],
  Graphics[{Red, PointSize[Large], Point[nest]}],
  PlotRange -> {{0, xmax}, {0, ymax}}], {i, 1, steps, 1}]

The issue I have is that Mathematica seems to have a memory leak, as the Animate, or manipulate, or exporting to gif runs, the amount of memory allocated to Mathematica keeps growing until it just stops working. Below is a gif in which I turn the animation on and off to show that the memory keeps growing as Animate (or Manipulate) runs. A bummer because this limits the number of ants and steps to use. Hope we can get some feedback on what is going on.

POSTED BY: Diego Zviovich
1 year ago