diff --git a/Fractal_en.png b/Fractal_en.png new file mode 100644 index 0000000..e6af6cd Binary files /dev/null and b/Fractal_en.png differ diff --git a/MVC_en.png b/MVC_en.png new file mode 100644 index 0000000..40f4be8 Binary files /dev/null and b/MVC_en.png differ diff --git a/README.md b/README.md index 83209e4..6aa9cca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,49 @@ -# Explanation of demo + structure -file -> packages \ No newline at end of file +# MVC pattern + +This application follows a MVC (Model-View-Controller) pattern for the GUI communication. + +![MVC pattern applied on this project](MVC_en.png) + +# Sierpinski's fractals demo + +This demo is about Sierpinski's fractals. Those are 3 triangles inside a triangle. + +![Agents organization in the fractal demo](Fractal_en.png) + +To create this demo, only one agent was required. The idea is to create a main agent and then create 3 other agents in the inner context of the main agent. Then the main agent becomes an event broadcaster and so on and so forth for each fractals newly created. + + +```Scala +agent Fractal { + ... + + on Initialize { + if (occurrence.parameters.size >= 2){ + // If initialized with arguments + + screenSurface = occurrence.parameters.get(0) as Square + positions = occurrence.parameters.get(1) as Positions + + if (occurrence.parameters.size.equals(3)){ + // If initialized by the GUI + var ctrl = occurrence.parameters.get(2) as FXMLViewerController + guiSpace = defaultContext.createSpace( + OpenEventSpaceSpecification, UUID.randomUUID) + ctrl.setGUISpace(guiSpace) + guiSpace.register(asEventListener) + } + } else { + // If initialized without argument + screenSurface = new Square + positions = new Positions + } + screenWidth = screenSurface.width + this.generatePoints + } + + ... + +} +``` + +![Application with the GUI](sierpinski_screenshot.png) \ No newline at end of file diff --git a/sierpinski_screenshot.png b/sierpinski_screenshot.png new file mode 100644 index 0000000..e5cc723 Binary files /dev/null and b/sierpinski_screenshot.png differ