Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.
Hello! I studied Computer Science, and live in Bath. I write code, design games, and occasionally tweet.

Posts about Algorithms Other Categories

Roulette, An Intelligent Negotiating Agent Jan. 9, 2018 in Algorithms, Java, Text, University

When making decisions, people negotiate to maximise utility and social welfare - agents are no different. Utilizing the GENIUS framework, this report tests time dependent concessions, and fitness proportionate selection putting them to test in a negotiation competition. The results are analysed and discussed.

  • CSS Concept: Computing methodologies → Intelligent Agents
  • Keywords: Agents, Negotiation, Competition, Selection, Roulette

Continue Reading...

Competing in the NWERC Regionals Nov. 26, 2017 in Algorithms, Competitions, Photos

We came, we saw, we lost. Image courtesy Dorota Filipczuk.

Our teams

An Imperative Stream Programming Language Apr. 28, 2016 in Algorithms, Text, University

This is the user manual for the Aqua programming language created as part of Programming Languages and Concepts. Visit the project on Github.

Aqua is a C­-like imperative language, for manipulating infinite streams. Statements are somewhat optionally terminated with semicolons, and supports both block ( /* ... */) and line comments ( // ...).Curly brackets are used optionally to extend scope. Example code can be found in the Appendices.

Before continuing, it’s helpful to familiarise yourself with Extended BNF. Special sequences are used to escape.

Usage Instruction

Once the interpreter has been compiled using the make command, you can choose to run an interactive REPL or a stored program. Executing ./mysplinterpreterwith no arguments will start in an interactive REPL . You should save your program files as <filename>.spl and pass the location as the first argument to ./mysqlinterpreter. As data is read from standard in, you can pipe files in using the < operator, or pipe programs in using the | operator, allowing you to create programs that manipulate infinite streams.

  • Starting the interactive REPL: ./mysplinterpreter
  • Executing a saved program: ./mysplinterpreter <file> [ < <input> ]
  • Using infinite streams: <program> | ./mysplinterpreter <file>

Programs are executed in multiple stages:

  1. Entire program is loaded into a string (Unix line endings required)
  2. Program is lexed into Tokens
  3. Tokens are parsed into an Abstract Syntax Tree (Left associative with the exception of lambdas)
  4. Types are checked to ensure logical behaviour
  5. Finally the Abstract Syntax Tree is executed

Continue Reading...

CodeCon Finals at Bloomberg HQ Jan. 30, 2016 in Algorithms, Competitions, London, Photos

This week I had the pleasure of competing in the CodeCon Grand finals at Bloomberg’s London headquarters. While unfortunately I didn’t do that well, visiting the headquarters and exploring London was great fun. I didn’t take any pictures inside the event, I thought I would share a few photos taken on during my trip.

Museum of London St. Paul's Cathedral

The day after the competition, I left the hotel and set of through the city. The Museum of London was nearby, so I checked it out. While there it started raining and a rainbow appeared. Then, a quick walk lead me to St. Paul’s.

Panorama 1

Panorama 2

While, crossing the Millennium Bridge I took two panoramas of the Thames. Unfortunately the day was overcast, and so the pictures are rather gray.

Tate Modern

Finally ending my trip inside the Tate Modern where I saw Abraham Cruzvillegas Empty Lot filling the Turbine room.

Solving Block World Search Nov. 26, 2015 in Algorithms, Java, Text, University

Block world is a simple 2D sliding puzzle game taking place on a finite rectangular grid. You manipulate the world by swapping an agent (In this case the character: ☺) with an adjacent tile. There are up to 4 possible moves that can be taken from any tile. As you can imagine, with plain tree search the problem quickly scales to impossibility for each of the blind searches.

It is very similar to the 8/15 puzzles, just with fewer pieces, meaning it’s simpler for the algorithms to solve. It’s unlikely any of my blind searches could solve a well shuffled tile puzzle with unique pieces, but I suspect my A* algorithm could. However, before doing so I would want to spend time improving my Manhattan distance heuristic, so it gave more accurate results over a larger range.

I decided to use Java to solve this problem, as I’m familiar with it and it has a rich standard library containing Queue, Stack, and PriorityQueue. These collections are vital to implementing the 4 search methods. You can implement the different searches differently, but the data structures I listed just deal with everything for you.

Continue Reading...