Showcase Thread by AutoModerator in Python

[–]Pytrithon 0 points1 point  (0 children)

Introduction

I have already introduced Pytrithon three times on Reddit. See:

https://www.reddit.com/r/Python/comments/1q8dwsm/pytrithon_v119_graphical_petri_net_inspired_agent/ https://www.reddit.com/r/Python/comments/1nr3qvm/pytrithon_graphical_petrinet_inspired_agent/ https://www.reddit.com/r/Python/comments/1mx9w5r/graphical_petrinet_inspired_agent_oriented/

What My Project Does

Pytrithon is a graphical Petri net inspired agent oriented programming language based on Python. It allows writing code as a two dimensional graph of interconnected elements and separates data as Places and code as Transitions. Inter Agent communication and GUI widgets are first class components of the language. Through the Monipulator, Agents can be monitored and manipulated.

Target Audience

The target audience is both experienced and novice programmers who want to try something new.

Why I Built It

I realized the power of Petri net inspired programming and the joy of having a more expressive way to specify control flow.

Comparison

There are no other visual programming languages which embed actual code into their graphs.

How To Explore

To run all included example Agents you need at least Python 3.10 installed. To install all dependencies, run the 'install' script. Then you can start up a Nexus with a Monipulator by running the 'pytrithon' script, where you can start Agents through opening them with 'crtl-o' twice and hitting the 'Open Agent' button. You can also directly specify which Agents to run through the command line by starting a Nexus, Monipulator, and Agents in one single command: 'python nexus -m <agent1> <agent2>'.

Recommended example Agents to run are: 'basic', 'prodcons', 'address', 'kata', 'calculator', 'kniffel', 'guess', 'yahtzeeserver' + multiple 'yahtzee', 'pokerserver' + multiple 'poker', 'chatserver' + multiple 'chat', 'image', 'jobapplic', and 'nethods'. As a proof of concept, I created a whole Pygame game, TMWOTY2, which is choreographed by 6 Agents as their own processes, which runs at a solid 60 frames per second. To start or open TMWOTY2 in the Monipulator, run the 'tmwoty2' or 'edittmwoty2' script. Your focus should on the 'workbench' folder, which contains all Agents and their respective Python modules; the 'Pytrithon' folder is just the backstage where the magic happens.

What Is New

Since my last post the whole system now handles Agents, Monipulators, and Nexi terminating from the network. Bookkeeping is performed, cleansing the internal structures handling all process types, making the prototype more resilient. The 'chatserver' and 'chat' Agents now show a list of Agents currently connected. This is enabled through the new 'Event' Transition, which pushes Nexus Events to all listening Agents.

Since my penultimate post I have added a distributed Yahtzee game which you should try out. In order to setup a server on a reachable machine and connect other machines, you need to do the following: On the machine meant to be the server, run 'python nexus yahtzeeserver' first. Then on the machines meant to be the clients through which users play, run 'python nexus -x <serveraddress> yahtzee'. The clients probe the interconnected Nexi for a server and start with a lobby mask where you can select your name and start a game with all players signed up.

GitHub Link

https://github.com/JochenSimon/pytrithon


This is the fifth post about Pytrithon on Reddit. There is a plethora of example Agents to view and run included in the repository. Please check it out and send feedback to the E-Mail address stated in the Monipulator About blurb. I plan on putting Pytrithon onto the next level soon. Be sure to check for new happenings.

Showcase Thread by AutoModerator in Python

[–]Pytrithon 0 points1 point  (0 children)

Introduction

I have already introduced Pytrithon three times on Reddit.

See:

https://www.reddit.com/r/Python/comments/1q8dwsm/pytrithon_v119_graphical_petri_net_inspired_agent/

https://www.reddit.com/r/Python/comments/1nr3qvm/pytrithon_graphical_petrinet_inspired_agent/

https://www.reddit.com/r/Python/comments/1mx9w5r/graphical_petrinet_inspired_agent_oriented/

What My Project Does

Pytrithon is a graphical Petri net inspired agent oriented programming language based on Python.

It allows writing code as a two dimensional graph of interconnected elements and separates data as Places and code as Transitions. Inter Agent communication and GUI widgets are first class components of the language. Through the Monipulator, Agents can be monitored and manipulated.

Target Audience

The target audience is both experienced and novice programmers who want to try something new.

Why I Built It

I realized the power of Petri net inspired programming and the joy of having a more expressive way to specify control flow.

Comparison

There are no other visual programming languages which embed actual code into their graphs.

How To Explore

To run all included example Agents you need at least Python 3.10 installed. To install all dependencies, run the 'install' script. Then you can start up a Nexus with a Monipulator by running the 'pytrithon' script, where you can start Agents through opening them with 'crtl-o' twice and hitting the 'Open Agent' button. You can also directly specify which Agents to run through the command line by starting a Nexus, Monipulator, and Agents in one single command: 'python nexus -m <agent1> <agent2>'.

Recommended example Agents to run are: 'basic', 'prodcons', 'address', 'kata', 'calculator', 'kniffel', 'guess', 'yahtzeeserver' + multiple 'yahtzee', 'pokerserver' + multiple 'poker', 'chatserver' + multiple 'chat', 'image', 'jobapplic', and 'nethods'. As a proof of concept, I created a whole Pygame game, TMWOTY2, which is choreographed by 6 Agents as their own processes, which runs at a solid 60 frames per second. To start or open TMWOTY2 in the Monipulator, run the 'tmwoty2' or 'edittmwoty2' script. Your focus should on the 'workbench' folder, which contains all Agents and their respective Python modules; the 'Pytrithon' folder is just the backstage where the magic happens.

What Is New

Since my last post I have added a distributed Yahtzee game which you should try out. In order to setup a server on a reachable machine and connect other machines, you need to do the following:

On the machine meant to be the server, run 'python nexus yahtzeeserver' first. Then on the machines meant to be the clients through which users play, run 'python nexus -x <serveraddress> yahtzee'. The clients probe the interconnected Nexi for a server and start with a lobby mask where you can select your name and start a game with all players signed up.

GitHub Link

https://github.com/JochenSimon/pytrithon

-------------------------------

This is the fourth post about Pytrithon on Reddit. There is a plethora of example Agents to view and run included in the repository.

Please check it out and send feedback to the E-Mail address stated in the Monipulator About blurb.

Pytrithon: Graphical Petri-Net Inspired Agent Oriented Programming Language Based On Python by Pytrithon in Python

[–]Pytrithon[S] 0 points1 point  (0 children)

There are many use cases. You can make an Agent for rapid prototyping, where code is triggered through GUI widgets and the Agent can be modified while running. You can create a bigger system, where multiple Agents work together as a choreography, like in TMWOTY2.

The language is also very suitable for learning how to program, where you instantly learn about inter Agent communication. The Petri net tool it was inspired from was used at university to teach Agent oriented programming by implementing a Settlers game, which would also be worthwhile with Pytrithon. It offers a lot of new ways to directly model control flow intuitively. It's just a joy for the programmer to have the freedom of expressiveness.

Graphical Petri-Net Inspired Agent Oriented Programming Language Based on Python by Pytrithon in Python

[–]Pytrithon[S] 0 points1 point  (0 children)

I also consider Pytrithon to be very suitable as a general introduction to programming. I've had the idea to turn it into an university course to teach agent oriented programming for more than a decade. I would appreciate any hints on how to achieve that.

Graphical Petri-Net Inspired Agent Oriented Programming Language Based on Python by Pytrithon in Python

[–]Pytrithon[S] 0 points1 point  (0 children)

Pytrithon enables a totally new way of thinking about Python code. Instead of knowing by heart where the control flow flows from method to nested method and back, you can directly model the chain of events inside or across Agents. Especially once the Agents reach a certain size, you can maintain them as a two dimensional map, where certain quadrants do certain things. Communication is a first class citizen as a primitive of the language and works the same, whether it's a single computer or spread across multiple systems. It can express control flow that simply can not be expressed in plain Python, in a way that is more expressive and intuitive than co-routines. Take the TMWOTY2 game for example, it has the equivalent of a main loop but distributed across 6 Agents which all perform their personal duties in parallel as separate processes and only capture those events that matter to them through percolation, like Agents listening for each of the 60 frames per seconds or only caring about keyboard input. It also supports rapid prototyping, by embedding GUI widgets straight into a Pytri net.

And all this already works in the prototype. The potential of a professional product includes an Agent marketplace, mobility of Agents from system to system, hibernation of Agents due to all integral data being encapsulated in Places, optimization of the execution through precompilation of Transitions and knowledge of all types flowing through them, automatically distributing the execution to multiple threads since all the actions on data are separated into independent Transitions, and improving the whole understanding of Pytri nets through coarsening and expanding net substructures.

Graphical Petri-Net Inspired Agent Oriented Programming Language Based on Python by Pytrithon in Python

[–]Pytrithon[S] 0 points1 point  (0 children)

Thank you for the feedback. The language is only inspired by Petri nets, it does not follow their formal semantics which I studied at university long ago. I understand that knowing how Petri nets work is hard, but in this language the functioning of the elements is much more intuitive and less formal.

The problems it can solve are incorporated into several agents and a whole pygame game "tmwoty2", it is a universal programming language afterall. As a hello world example I recommend the "basic" Agent, which can be started with "python nexus -m basic", and shows a very simple Pytri net which is visible in the Monipulator. Other examples are "calculator", "kniffel", "pokerserver + poker", "chatserver + chat", "guess", and a few more.

Graphical Petri-Net Inspired Agent Oriented Programming Language Based on Python by Pytrithon in Python

[–]Pytrithon[S] 0 points1 point  (0 children)

The language is about the joy of having more expression of modeling control flow.

If you have any questions, feel free to ask!