Message Boards Message Boards

Brownian Motion Maze Solving (based on "The Dumbest Way To Solve A Maze")

Posted 1 year ago

enter image description here

2 Replies

Choose the coordinates describing the foundations of the Lines...the way you form the uniform distributions, these are some descriptive lines! What did we get from the futuristic foundation of the cellular automaton based on, we can't get anything from the cellular automaton. This is so creative, watch the balls diverge at the beginning. Here's something we can do: focus on having the desire to decide to run the simulation so many times until the end motion catches up to the end-difficulty..that's 2000 balls but no walls!? When y'all tie all the vectors together and graph this Brownian Motion, it looks like maze-solving doesn't it.

Brownian Motion like Maze Solving

g = GridGraph[{8, 12}];
spanningTree = 
  NeighborhoodGraph[g, RandomSample[VertexList[g], 8*12], 1]]

RandomFunction[WienerProcess[\[Mu], \[Sigma]], {0, 1, .001}, 2][
"States"], {\[Mu], .001, 1, .1}, {\[Sigma], .001, 1, .1}]], 
PlotTheme -> "Detailed", PlotRange -> Full, 
ColorFunction -> "Rainbow", ImageSize -> 300]

Brownian Motion Simulator

Have you seen the other, the new Brownian Motion Simulator WienerProcess? It's so dynamic it's disgusting. I always wondered how you drew the EEG signal of a cat, a nematode, like that, and how you do the Dynamic content. The color resembles burnt coffee, it's a new world thing. I guess that, I should thank Donavon for being such a pal and for being my ghost philosopher, James for the Brownian Motion Graph, and Varun for the Demonstrations Projects. I asked him and he said...these successor balls just keep coming in and updating, wouldn't it be nice if we could map them all out?

dims = {3, 5};
hallwayThickness = 0.8;
ballCount = 100;
initPs = {1 + hallwayThickness/2, dims[[1]] + hallwayThickness/2};
g = GridGraph[dims];
spanningTree = 
  FindSpanningTree[GridGraph[dims, EdgeWeight -> {_ :> RandomReal[]}]];
wallsRegion = RegionDifference[
     #, Rectangle[{dims[[2]], hallwayThickness},
      {dims[[2]], 0} + {hallwayThickness, 1}]] &@
    Rectangle[{1, 1} - 1 + hallwayThickness, Reverse[dims] + 1],
      Line[GraphEmbedding[spanningTree][[#]]] & /@ 
       List @@@ EdgeList[spanningTree]],
     Rectangle[{0, 0}, {1, 1}*hallwayThickness]]];
positionSeries = Reap[
    Sow[ps = ConstantArray[initPs, ballCount]];
     And @@ RegionMember[
        Rectangle[{1, 1} - 1 + hallwayThickness, Reverse[dims] + 1]][
     vs = RandomPoint[Circle[], ballCount]*0.1; ps += vs;
     ps -= vs*Boole[RegionMember[wallsRegion][ps]]; Sow[ps]]][[2, 
winningIndex = FirstPosition[
      Rectangle[{1, 1} - 1 + hallwayThickness, Reverse[dims] + 1]]@
     Last@positionSeries, False][[1]];
ballDistanceRanking = 
  Max /@ Total[(Threaded[initPs] - 
       Transpose[positionSeries])^2, {3}]]; distanceFromStartGrid = 
 Function[positions, EuclideanDistance[initPs, #] & /@ positions];
distanceFromEndGrid = 
   EuclideanDistance[Reverse[dims] + 1, #] & /@ positions];
plotScatterPlot = Function[{i, distances},
   ListPlot[{Transpose[{Range[Length[distances]], distances}],
     {{winningIndex, distances[[winningIndex]]}}},
    PlotStyle -> {Automatic, Directive[Red, PointSize[Large]], 
      Directive[Blue, PointSize[Large]]},
    PlotTheme -> "Detailed", PlotRange -> All, 
    ColorFunction -> "Rainbow",
    Frame -> True, FrameLabel -> {"i", "Distance Euclidean"},
    LabelStyle -> {White, 12}, Background -> White, ImageSize -> 300]];
 Row[{Graphics[{Black, Opacity[0.5], wallsRegion,
     {Magenta, Thick, Circle[positionSeries[[i, winningIndex]], 0.2], 
      Thick, Line[positionSeries[[;; i, winningIndex]], 
       VertexColors -> (ColorData["Rainbow"] /@ Rescale[Range[i]])]},
     {Yellow, Thick, Circle[positionSeries[[i, vertexIndexed]], 0.2], 
      Thin, Line[positionSeries[[All, vertexIndexed]]]},
     Green, Opacity[1], PointSize[Medium], Point[positionSeries[[i]]],
      Magenta, Opacity[1],
     Line[positionSeries[[All, ballDistanceRanking[[pathSelect]]]]],
     Yellow, Line[positionSeries[[All, vertexIndexed]]]
     }, ImageSize -> 300, Background -> White],
   plotScatterPlot[i, distanceFromStartGrid[positionSeries[[i]]]],
   plotScatterPlot[i, distanceFromEndGrid[positionSeries[[i]]]]}], {i,
   1, Length[positionSeries], 1, Appearance -> "Open", 
  AnimationRate -> 10},
 {vertexIndexed, 1, ballCount, 1, Appearance -> "Open"},
 {pathSelect, 1, ballCount, 1, Appearance -> "Open"}]

This is a beautiful topic and I don't know how else to put it. I guess that I really shouldn't have used the resource for vector art, the spanningTree. I did a flip flop, put the old maze back and now we can more clearly delineate the Boolean of wall membership, when you lump it by itself..lump? No, no. Sow the position parts? Sow the position parts. Show how we can get the positionSeries for instance to show the path for one particle field, set some directions for future research. It would be so cool to put some magnetic fields or maybe wind. What would be the meaning of that?

Ya know, how philosophy symbolically reduces to explain the nature of everything. And in this retro simulation we've got a can-full of worms, spider-like paths, in pseudo-random velocity, in a maze. What would you do, if you wanted to in form form the passages and walls and had a FindSpanningTree and GridGraph?

Brownian Motion

I wonder why maybe because we haven't done experiments on Brownian Motion or not? Because we don't know? Dohh, I don't know. I used to traverse your simulation, last time and actually this is even more fun I think I escaped the big maze and now we've got a new maze. Maze traversal just wouldn't be the same without you.

What is this, a simulation for ants? It's a watercolor made for the ants. That's the extent of, the particles go from the place they're transmitted to the place they're received, which may or may not be the place at which the grid starts and stops.

POSTED BY: Dean Gladish

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract