Skip to content

Instantly share code, notes, and snippets.

@tiagodalloca
Created March 26, 2019 14:29
Show Gist options
  • Save tiagodalloca/2563faf2d267fbb6596e569fe2f558db to your computer and use it in GitHub Desktop.
Save tiagodalloca/2563faf2d267fbb6596e569fe2f558db to your computer and use it in GitHub Desktop.
class SickZombie {
private boolean paralysis, yellow_tong, member_loss, chest_pain, trembling_finger, severe_anger, history_bacteria;
public SickZombie(boolean paralysis, boolean yellow_tong, boolean member_loss, boolean chest_pain, boolean trembling_finger, boolean severe_anger, boolean history_bacteria){
this.paralysis = paralysis;
this.yellow_tong = yeallow_tong;
this.member_loss = member_loss;
this.chest_pain = chest_pain;
this.trembling_finger = trembling_finger;
this.severe_anger = trembling_finger;
this.history_bacteria = history_bacteria;
}
public bool responde (String pergunta){
pergunta = pergunta.toLowerCase();
if (pergunta.contains("paralisia")) return paralysis;
if (pergunta.contains("língua")) return yeallow_tong;
if (pergunta.contains("membro")) return member_loss;
if (pergunta.contains("peito")) return chest_pain;
if (pergunta.contains("mão")) return tremblind finger;
if (pergunta.contains("raiva")) return severe_anger;
if (pergunta.contains("bactéria")) return history_bacteria;
}
}
class Doctor {
private DataSetComponent ds;
private String[] perguntas;
public Doctor(){
DataSetComponent ds = new DataSetComponent();
ds.setDataSource("../../../../db/zombie/zombie-health-spreadsheet-ml-training.csv");
perguntas = {
"Tu tá com paralisia?",
"Sua língua tá amarela?",
"Tu perdeu algum membro?",
"Você tem dor no peito?",
"Sua mão está tremendo",
"Ce tá com raiva?",
"Tem histórico com bactéria?"
};
}
public bool responde (SickZombie z) {
boolean[] respostas = new boolean[7];
for (int i = 0; i < 7; i++)
respostas[i] = z.pergunta(perguntas[i]);
String instances[][] = ds.requestInstances();
for (int i = 0; i < instances.length; i++) {
for (int a = 0; a < attributes.length-1; a ++)
System.out.print(instances[i][a] + ", ");
System.out.println(instances[i][attributes.length-1]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment