kelvinlimwan / Moral-Machines-Experiment

An Ethical Engine that decides between saving the lives of passengers in a car or pedestrians given precarious scenarios.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Moral Machines Experiment

The idea of Moral Machines is based on the Trolley Dilemma, a fictional scenario presenting a decision-maker with a moral dilemma: choosing ''the lesser of two evils''. The scenario entails an autonomous car whose brakes fail at a pedestrian crossing. As it is too late to relinquish control to the car's passengers, the car needs to make a decision based on the facts available about the situation.

Feel free to familiarize yourself with the problem and explore different scenarios on MIT's Moral Machine Website.

The Ethical Engine algorithm is designed to explore different precarious scenarios and decide between saving either the life of the car's passengers or the life of the pedestrians. Its decision-making is audited through simulations, and it allows users to judge the outcomes themselves.

Tests

We have made two types of local tests available: 1) an invocation test with some basic assertions and 2) a program input/output test.

The TestRunner

The file TestRunner.java comprises a range of methods to instantiate and invoke the basic functionality of the code. You can run it as follows:

javac TestRunner.java && java TestRunnner

Scenario Import and Interactive Mode Test

The tests folder comprises the following files to test the code locally.

To test the logic and the expected output in interactive mode, run the program with the following parameters:

java EthicalEngine -i -c tests/config_3.csv < tests/in_interactive_config_3 > output

This command will run the EthicalEngine main method in interactive mode. It will import three scenarios from the config_3.csv file and pipe in the pre-defined user input from the in_interactive_config_3.

About

An Ethical Engine that decides between saving the lives of passengers in a car or pedestrians given precarious scenarios.


Languages

Language:Java 100.0%