Skip to content

Latest commit

 

History

History
58 lines (33 loc) · 2.05 KB

File metadata and controls

58 lines (33 loc) · 2.05 KB

actors

Obtains the average age of all actors appearing in movies currently in theaters.

Running the program: To build, simply run make in the top level folder The executable with be stored in the bin folder (./bin/actors)

To run from the top level, simply ./run.sh

Design:

I approached this problem by noticing that it can easily be abstracted into a more general problem that can be used to simplify a variety of problems:

  Given an arbitrary dataset, provide a reduction strategy that combines all data into
  a desired result

Currently, there is no infrastructure in SML/NJ that provides the tools needed to carry out this task. My approach to this problem was to create this generalized reduction platform and then provide a concrete implementation for averaging the age of actors in in-theaters movies.

Structure:

The abstract specification files can be found in the /actors-src/reduction directory and the concrete representation can be found in the /actors-src/actors-imp directory.

Everything needed to carry out the main function (such as file parsing, running the reduction) can be found in /actors-src/main

There is a non-generic solution in /actors-src/solution/ that I implemented to help me figure out how to properly make the framework as generic as possible

What actually happens when the executable is run:

A java utility is run to extract information off of Rotten Tomatoes. It does not actually find any actor's age, instead it randomly generates a number.

When finished, the SML compiled reduction algorithm is run on the output generated by the utility, printing results to the terminal.

Problems arose during development:

SML is not as highly developed as many other languages. Reading documentation on network sockets amounts to reading MLton's source code for sockets

TO-DOs:

Increase the capability of the Java actor-acquisition utility to find each actor's actual age

Add in a parallel multithreading to the infrastructure to help manage large loads