comp3710-group-project-1's People
Forkers
matp101comp3710-group-project-1's Issues
Genetic Agent
- GAs need to keep track of both their own, and opponent's move history. This is for next move selection
- A fitness function must be created. Easiest is probably use the scores from the Reward Table to keep track of total score in current generation
- Mutations will be small random changes to a 'fit' individual (ie make a mutating constructor from an existing agent that makes a small change to bitstring)
- Bitstring will determine whether to cooperate or defect based on self and opponent move history (choose function must encode move history into a bit position in bitstring)
Create data collection class for GAs
GAs are getting bloated with all the data collection I've added. Ideally, agents should be agile and lightweight.
We should strip all the data collection out of the agent and make a separate class for data collection on GAs. This class can be bloated with data collection. Keep data on individuals during testing. We can keep lots of individuals in a population for learning, but testing data will be collected on a small number of trained individuals.
Run Game function
We need a function that will accept two Agent
subclasses, and run a game between the two of them. Fifty turns in each game.
- Parameters are two (pre-constructed)
Agent
subclass objects - Fifty turns in a game
- Each agent holds its own score internally, but you will need to manually increment it (use reward table to determine scores)
- Return a tuple with agent scores
Reward Table:
p1 \ p2 | cooperate | defect |
---|---|---|
cooperate | 3, 3 | 0, 5 |
defect | 5, 0 | 1, 1 |
Update README with GA implementation
README contains some junk as a placeholder on how GAs should work; replace that with documentation on how we implemented our GAs, as well as initial findings (GA vs GA with default reward table results in agents that always cooperate)
Training algorithms for GAs
- GAs should have a way to save trained agents, so we can run a big training session overnight and use those agents for testing (save their rulesets)
- A full set of training should be done with both reproduction methods (mutation %, two parents, etc), against each different agent. Log the top 10 fittest agents in a dictionary, so we have a collection of a few hundred trained agents to use for testing
Data Collection on GAs
GAs are finished and trainable, so now we need to put them to work.
- Test fittest GA in a population after a round of training against different agents
- Data needs to be collected into .csv files
Genetic Mutations Manager/Environment
this is a back burner item, this comes after all the simple agents are working and actually testable
- have a population of 100
- test them against various agents
- Mutate the top 5-10% to produce next generation
- Compare trained agents to different agents
Since we have limited time, it is probably best to compare GA to each other agent once. Each gets a training session, then a test session. There is such a thing as too much data
Batch Testing
Class for batch testing will:
- Initialize with two agent class types as parameters, as well as the game length in turns and the total number of games
- Run N games between the two, recording the results of each game
- Return a tuple, containing the average (fitness) score of each agent across the batch
need a new way to raise errors
msilib is a windows exclusive, we should find something that isn't platform-specific
(I can work on windows, but I prefer my server, which is linux)
GAs need mutation parameters
- Reproduction: random point crossover with replacement (dual parent)
- Variable mutation rate for single reproduction
Comparison Function
A list of available agent types (variations of the Agent superclass) would be constructed, and played against each other. It is possible to hard code all the permutations of agents, but if we want scaleable code, this HAS to be automated.
- A list of classes could be made passed, and then use
itertools.permutations
to make the table of type comparisons. - For now, this does NOT include genetic agents. This will be a separate function, as we need to train the genetic agents. ONLY include simple agents in this list (TFT, TF2T, etc)
- This function simply needs to create combinations with replacement of agents to test; another function will be called from this function to actually run the batch testing on each matchup. Results will be returned. This function will need to record results into a list. This list will be recorded and returned.
- Each batch result will be two tuples, with the average score of each agent as the values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.