Angel \”Java\” Lopez on Blog

June 22, 2008

Distributed Agents and Fractals using DSS/VPL

Last week I wrote the base of an application running distributed agents over DSS/VPL, interchanging arbitrary messages, with automatic load balancing. You can read the details at:

Distributed Agents using DSS/VPL

Today, I extended the example with a new project, Fractal:

You can download from my Skydrive.

It has two DSS Service Components, one is the Calculator: it calculates a sector of the Mandelbrot fractal. The other component is the Renderer, that has a form to control and show the results of the calculation. The message that has the info of the sector to calculate is:

public class SectorInfo : MessagePayload { public double RealMinimum { get; set; } public double ImgMinimum { get; set; } public double Delta { get; set; } public int FromX { get; set; } public int FromY { get; set; } public int Width { get; set; } public int Height { get; set; } public int MaxIterations { get; set; } public int MaxValue { get; set; } }

Another class is the message that returns the calculation:

public class Sector : MessagePayload { public int FromX { get; set; } public int FromY { get; set; } public int Width { get; set; } public int Height { get; set; } public int[] Values { get; set; } }

The calculator splits the sector to calculate, if it too big. It can calculate all in only one step, but it is interesting to split the sector to generate more messages:

 

private void Calculate(AgentMessage msg) { LogInfo("Entering Calculator with Action: " + msg.Action); SectorInfo sectorInfo = (SectorInfo) msg.Payload; LogInfo(String.Format("X {0} Y {1} Width {2} Height {3}", sectorInfo.FromX, sectorInfo.FromY, sectorInfo.Width, sectorInfo.Height)); if (sectorInfo.Width > 100 && sectorInfo.Height > 100) SplitSector(sectorInfo); else CalculateSector(sectorInfo); }

As in the previous example, you can run this from a VPL diagram, FractalVpl1:

There is only one renderer, and two calculators agents. If you launch this VPL program, a window appears. This is the initial window content (after pressing the Calculate button):

You can drag and move the mouse to select a new region, or use the buttons to zoom in and out. Reset backs to the initial position. You can resize the window and invoke Calculate again. New colors button changes the color palette in use.

There is another VPL program, FractalVpl2, that it can be used to run the same example in a distributed way. It has a diagram with two AgentHosts:

and two nodes:

You must compile the VPL example and run as distributed nodes, using the rundeployer.cmd (see my previous post for details).

These some of the drawings the system produces:

 

Enjoy!

Angel “Java” Lopez
http://www.ajlopez.com/en

10 Comments »

  1. Too awesome!

    Comment by Arvindra Sehmi — June 23, 2008 @ 5:16 am

  2. [...] You can get Angel’s blog, agent toolkit and sample applications here. [...]

    Pingback by Sehmi-Conscious Thoughts : Gorgeous Fractals with VPL and Distributed DSS Services — June 23, 2008 @ 5:43 am

  3. [...] just offers up too many pleasant distractions, doesn’t it?  Here’s a cool blog entry about using VPL to create fractal images.  I haven’t spent much time playing with this – [...]

    Pingback by Contagious Curiosity : Distributed Agents and Fractals using DSS/VPL — June 23, 2008 @ 3:31 pm

  4. Great work! Makes me want to create another render farm and spin up some animations!

    Comment by Phil Wheat — June 24, 2008 @ 2:46 am

  5. [...] Distributed Agents and Fractals using DSS/VPL [...]

    Pingback by Fractal application revisited « Angel “Java” Lopez on Blog — December 17, 2008 @ 9:46 am

  6. [...] out to me as someone who’s really gotten into Robotics Studio.  I went to check his blog at http://ajlopez.wordpress.com/2008/06/22/distributed-agents-and-fractals-using-dssvpl/ and was incredibly impressed.  He’s not only put together some great mathematical services for [...]

    Pingback by Phil Wheat : Now THERE's someone doing some productive work with Robotics Studio! — December 17, 2008 @ 10:49 pm

  7. [...] Distributed Agents and Fractals using DSS/VPLAgentes Distribuidos usando DSS/VPL [...]

    Pingback by Fractal revisitado - Angel "Java" Lopez — December 19, 2008 @ 1:20 pm

  8. [...] Distributed Agents and Fractals using DSS/VPLAgentes Distribuidos usando DSS/VPL [...]

    Pingback by Fractal revisitado | Buanzolandia — December 20, 2008 @ 12:00 am

  9. [...] out to me as someone who’s really gotten into Robotics Studio.  I went to check his blog at http://ajlopez.wordpress.com/2008/06/22/distributed-agents-and-fractals-using-dssvpl/ and was incredibly impressed.  He’s not only put together some great mathematical services [...]

    Pingback by Now THERE’s someone doing some productive work with Robotics Studio! « Knowledge Matters — December 19, 2009 @ 6:17 pm

  10. Hi Angel.
    I’m really interested in CCR and DSS and really appreciate your project’s concept.
    I would like to build the solution (agents + the fractal implementation) using MRDS 2008 R2 and VS2008 but I’m getting lots of errors (also after fixing the different \USER\ paths in the projects properties…

    in particular the proxy dll is not being generated.

    would you consider updating the solution to run with ccr/dss 2008 R2 and VS 2008 ?

    thank you and regards,
    Mario

    Comment by Mario — April 28, 2010 @ 2:45 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 65 other followers

%d bloggers like this: