Giter VIP home page Giter VIP logo

mst_termproject's Introduction

TEAM MST - NET/OSS3004 Term Project

FALL 2021

                                 ,-^-.
                                 |\/\|
                                 `-V-'
                                   H
                                   H        PlagueSim
                                   H           v0.9
                                .-;":-.
                              ,'  |  `; \

Team Members

  • Madeline Quang
  • Sayfullah Eid
  • Tolu Adebayo

GitHub Repository

General Structure

General Structure

Requirements

  • JavaSE-17

How To Use

  • Run(either method):
    • Main.main() in an IDE(e.g. Ecliplse, IntelliJ, VS Code)
    • $ java -jar TeamMST-v0.9.jar in a terminal
  • A Command Line Interface(CLI) should display in your terminal with a menu
  • Follow the prompts to use the program
  • You must first parse in a Graph in the Graph menu to use the rest of the functionality
  • Use Q to return to main menu, or quit the program
  • Available functions:
    • Graph
      • Import in a graph txt file, this will delete any current Graph data
      • Print the current graph, list of cities and their neighbours
    • Attack
      • Parse in an attack file
      • A new attack file does not reset the current Graph
    • Search
      • Get all cities that have had an attack
      • Get all cities that have a firewall
      • Get all cities that have a firewall and have been attacked
      • Get all cities that have an outbreak(and are not offline)
      • Get all cities that are currently offline
    • Path finding
      • Currently not working fully

TODO

  • Safe route:
    • List of 'safe' routes between two City nodes
    • Determine shortest routes

mst_termproject's People

Contributors

fusionstreak avatar madelinequang9 avatar sangchii avatar

Stargazers

 avatar

Watchers

 avatar

mst_termproject's Issues

Implement logic for adding attacks to graph

The parsing of the attack.txt into an Attack[] array is already done in Main. Need to define the logic inside Graph and City.

I did some work in City.addAttack() but you can adjust it to your liking.

/**
* The general function that will parse a new Attack object. It will: Add Attack
* to the corresponding City, Manage if there is an outbreak (and possible
* subsequent outbreaks), Manage if a City should be set to inactive
*
* @param a Attack object to be parsed
*/
public void attack(Attack a) {
// TODO: #2 Implement logic for adding attacks to graphs
}

/**
* Add{@code Attack a} to city. Parses through attacks in this city.
*
* If 2 or more of the same type as{@code a} within 2 minutes an alert is sent
* to{@code System.out}.
*
* If 4 or more of the same type as{@code a} within 4 minutes, return true for
* outbreak
*
* Determines if this city should be put offline, 6 or more attacks of at least
* 2 types
*
* Defaults to{@code false} if {@code currStatus == OFFLINE}
*
* @param a attack to be added
* @return {@code true} if outbreak,{@code false} otherwise
*/
public boolean addAttack(Attack a) {
this.attacks.add(a);
if (this.currStatus == Status.OFFLINE || this.firewall == true)
return false;
this.attackTypes.add(a.getType());
int within4 = 0;
int within2 = 0;
for (Attack attack : this.attacks) {
if (attack.getType() == a.getType()) {
long comp = a.compare(attack);
if (comp <= 120) {
within2++;
}
if (comp <= 240) {
within4++;
}
}
if (within4 >= 4)
return true;
}
if (within2 >= 2)
this.alert(a.getType());
if (this.putDown())
this.currStatus = Status.OFFLINE;
return false;
}

Implement searches

Need to implement the following search functions in Graph class.

// TODO: #4 Implement searches
/**
* Queries the Graph for all City objects that have been infected
*
* @return String of all cities that have been infected
*/
public String isInfected() {
return "";
}
/**
* Quries the Graph for all City objects that have a Firewall, i.e.
* city.firewall = true
*
* @return String of all cities that have a firewall
*/
public String hasFirewall() {
return "";
}
/**
* Queries the Graph for all City objects that have a firewall and have had an
* attempted attack
*
* @return String of a cities that have a firewall and have been attacked
*/
public String hasAttackedFirewall() {
return "";
}
/**
* Queries the Graph for all City objects that have had an outbreak
*
* @return String of all the cities that have had an outbreak
*/
public String outbreaks() {
return "";
}
/**
* Queries the Graph for all City objects that have been set to Inactive
*
* @return String of all the cities that have been set to Inactive
*/
public String inactive() {
return "";
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.