Final Year Project — B.A. (Mod.) in Computer Science, Linguistics and a Language
Trinity College Dublin
This project extends Allen's Interval Algebra (1983) by introducing probabilistic modeling and simulations to handle uncertainty in temporal relations and their composition.
- Implementation of the 13 Allen interval relations
- Composition (transitivity) table logic
- Probabilistic birth/death state transition simulations
- Interval generation with customizable parameters
- Statistical analysis and hypothesis testing
- Multiple simulation modes with varying parameters
- Batch simulation processing
- Automated report generation
To install the required dependencies:
pip install -r requirements.txt
constants.py
– Allen relation and state definitionsrelations.py
– Allen relations and composition logicintervals.py
– Interval generation and relation detectionsimulations.py
– Birth/death process simulation enginestats.py
– Statistical analysis and hypothesis testingbatch_runner.py
– Run multiple simulations with various parametersreport_generator.py
– Generate Markdown reports from simulation resultsrequirements.txt
– Python dependenciesREADME.md
– Project descriptionLICENSE
– MIT License
The project provides multiple ways to simulate and analyze interval relations:
-
Use
intervals.py
functions to generate random intervals and determine their relations:gen()
- Generate single intervals with birth/death probabilitiesrun()
- Generate two intervals and determine their relationmany()
- Run multiple simulations with identical parameterssimulate_relations()
- Generate intervals with different parameters for each interval
-
Use
simulations.py
for more complex state transition simulations:arSimulate()
- Run birth/death process simulationsdemo()
- Run a series of simulations with different parameters
-
Use
stats.py
to analyze relation distributions:entropy()
- Calculate information entropychi_square_uniform()
- Test against uniform distributionchi_square_against_theory()
- Compare against theoretical distributionsdescribe()
- Get comprehensive statistics
-
Use
batch_runner.py
to run large-scale simulations:- Automatically runs simulations with various probability combinations
- Saves results to a JSON file for further analysis
-
Use
report_generator.py
to create reports:- Generates a Markdown table summarizing simulation results
- Includes entropy, ratio statistics, and chi-square tests against different distributions
- Run batch simulations:
python batch_runner.py
- Generate a summary report:
python report_generator.py
- View the results in the generated
REPORT.md
file