Giter Site home page Giter Site logo

pyagency's Introduction

Agent Based Architecture Framework

Agency Platform

Based on Dr. Pearce's lecture

Motivation

Try and implement the agency platform implemented in Java8 in python and compare the ease of programming and design changes etc.

All in all, I'm doing this just for fun!

The Agent-based Architecture

The Agency is a platform for creating and running agent-based applications. It consists of three components: Facilitator, Agent, and Message.

A typical customization would create extensions of all three classes.

Facilitator

The facilitator maintains a list of all agents. Agents are added to the list using the add method. This method provides an agent with a reference to the facilitator and a unique id number. The facilitator provides synchronized services for delivering messages and for finding partners. The facilitator's start method runs in two modes: multi-threaded and single-threaded. In multi-threaded mode each agent is started, then joined. In single-threaded mode the facilitator repeatedly iterates through the agents, calling each ones update method until all of the agents are dead.

Agent

The Agent update method is abstract. It must be implemented in an extension. Usually the update method doesn't try to do too much: request a partner from the facilitator, send a message to a partner, check for incoming messages, etc. (Be careful, most Agent methods need to be synchronized.)

Message

The message is just a generic wrapper containing contents.

Examples:

  • Voting Patterns

    A precinct is an NxN grid of voter agents. A voter has a randomly assigned party affiliation (Republican or Democrat) and an address (i.e., its row and column in the precinct). A voter, V, updates itself by asking each of its 3, 5, or 8 neighbors in the precinct what their party affiliation is. If a majority have a different party, the V switches to that party. A settable precinct flag determines what to do in the case of a tie.

    Implement precincts and voters as a customization of the agency platform. Display the grid at the beginning of the run as a 2-dimensional array of Rs and Ds. Run the simulation for M cycles (try M = 100). Then display the grid again. What changes do you see? Does this explain the red-state/blue-state phenomenon?

Note: This project uses CPython 3.6.1, not tested or developed with other versions in mind

pyagency's People

Contributors

sidmishraw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.