Package: pade
Python Agent DEvelopment framework (PADE)PADE its a framework for developing, executing and mannaging multi-agent systems in distributed computing enviroments. PADE code is 100% Python and has its core in Twisted, a python package for implementing distributed applications.PADE is also free software and licenced in terms of MIT licence. First it was developed inFederal University of Ceará (Brazil) by Electric Smart Grids Group (GREI) in Electric Engineering Department (DEE).The researchers ofLaboratory of Applied Artificial Intelligence (LAAI) of Federal University of Para (UFPA)have been contributed a lot with PADE project. We registre here our acknowledgments.Everyone that has interest in developing PADE is welcome to download, install, test, use and send us feedback.Scientific PaperThere is a scientific paper presenting PADE as a scientific tool for multiagent system simulation with focus in electric power systems simulation. If you have interest here is the link to access:Python‐based multi‐agent platform for application on power gridsIf you use PADE in your research work, please cite PADE as:Melo, LS, Sampaio, RF, Leão, RPS, Barroso, GC, Bezerra, JR. Python‐based multi‐agent platform for application on power grids. Int Trans Electr Energ Syst. 2019; 29:e12012.https://doi.org/10.1002/2050‐7038.12012DocumentationPADE is well documented. You can access the documentation here:PADE documentationDependenciesPADE is developed inPython 3.7and has aTwistedcore.InstallVia Python Package Index (PyPI):$pipinstallpadeVia Github:$gitclonehttps://github.com/greiufc/pade
$cdpade
$pythonsetup.pyinstallSee the complete process in this video:HOW TO install PADEDockerBuild container$docker-composeup-dList containers$dockerps

CONTAINERIDIMAGE
8d7cb00972c9pade_padeGet inside container$dockerexec-it<CONTAINER_ID>bashExampleHello world in PADE:frompade.misc.utilityimportdisplay_message,start_loopfrompade.core.agentimportAgentfrompade.acl.aidimportAIDfromsysimportargvclassAgenteHelloWorld(Agent):def__init__(self,aid):super(AgenteHelloWorld,self).__init__(aid=aid)display_message(self.aid.localname,'Hello World!')if__name__=='__main__':agents_per_process=3c=0agents=list()foriinrange(agents_per_process):port=int(argv[1])+cagent_name='agente_hello_{}@localhost:{}'.format(port,port)agente_hello=AgenteHelloWorld(AID(name=agent_name))agents.append(agente_hello)c+=1000start_loop(agents)Changes in this new versionSome changes has been added in this new version, but don't worry about that if you are using pade in your simulations, it's very easy adjust this version in old versions.The main and bigger change in Pade is in how you launch your agents. Now when you install Pade via pip command or via setup.py install you install a pade terminal command line (cli) that launch your pade applications.Before we start an PADE example, it's important to create the initial database file in the temporary folder of your Operating System. As the temporary folder is cleared each time that you shutdown your OS you will need to run this command  in each reinitialization of your OS before executing PADE agents:$padecreate-pade-dbIf everything is well, than this message will apperar in your prompt:[...] Creating Pade tables in selected data base.
[ok_] Tables created in selected data baseAs example, if you put the hello world example code in a file with the name hello-agent.py and you want to launch this agent just one time, you could type in your command line interface:$padestart-runtimehello-agent.pyIf you want to launch this agent 3 times, than you type:$padestart-runtime--num3hello-agent.pyIf you wanto to launch the 3 agents in ports 20000, 20001 and 20002, than you just type:$padestart-runtime--num3--port20000hello-agent.pyHere we have to explain some points in how Pade executes the agents.When you type the commands--num 3and--port 20000you tell to Pade command line tool to execute the content of file hello-agent.py 3 times. Each time, the file content will be executed in a new process and the attribute port will be passed as argument in this process with a unit incremment in each time. For example, in the case--num 3and--port 2000, the arguments passed for agents are 2000, 2001 and 2002.This arguments should  be accessed in the code withsys.argv[1]. So you can execute how many agents as you want per process. In the hello-agent.py example there is a for loop that will repeat many times as defined in agents_per_process variable. That will define the number of agents in each process. In the example, since the--numparameter is 3 and the agents_per_process variable is 3 the pade will start 9 agents in ports: 20000, 21000, 22000, 20001, 210001, 22001, 20002, 210002 and 22002.The command line will support mode than one agent file too, for example if you have the agents in mode than one file you could start then with a command like this:$padestart-runtime--num3--port20000hello-agent_1.pyhello-agent_2.pyIn this case the first agent receive in thesys.argv[1]the value 20000 and the second, the value 20001, and so on.There is another way to launch the Pade agents. Is with a config file in the json format. Here it's a example of config file:{"agent_files":["agent_example_1.py","agent_example_3.py"],"port":20000,"num":2,"pade_ams":{"launch":true,"host":"localhost","port":8000},"pade_web":{"active":true,"host":"localhost","port":5000},"pade_sniffer":{"active":true,"host":"localhost","port":8001},"session":{"username":"pade_user","email":"pade_user@pade.com","password":"12345"}}To launch then, just type the command line:padestart-runtime--config_filepade_config.jsonIf you need to execute simulations with a high number of agents that send and receive messages, something like 500 agents sending 5 messages per second, is recommended that you launch your pade session with a option--no_pade_snifferbecause the register of this messages in database will overhead your pade execution. Than, the example could be:$padestart-runtime--num3--port20000--no_pade_snifferhello-agent_1.pyhello-agent_2.pyAnother useful commands in Pade CLI are:$padecreate-pade-db$padedrop-pade-db$padestart-web-interfaceTo show a complete list of pade comands in the CLI, just typepadein terminal command line.To show the agents in action, show the video in this link:pade agents start example