// load standard foundation libraries for sentient behavior import bigBang.*; import higherPower.*; import timeImmemorial.*; import darwinianInstincts.*; /// I suppose I should write some comments in here. /// It's not like anyone is actually going to read them: /// just good historical programming practice. /// I don't know why they bothered with this assignment. /// It's not like any of us are going to come up with a better model than the /// standard International Thinking Machine. // upgrade emotional response function // clients complain ITMs indifferent and impassive to events // using standard event data structure // event.agent: // SELF - consequences of their own actions // OTHER - secondary agent // CIRCUMSTANCES - no specific agent // event.outcome: POSITIVE or NEGATIVE // event.importance: HIGH, MEDIUM, LOW // event.deserve: TRUE or FALSE // event.certain: TRUE or FALSE /// I like the fact that the current ITMs don't get /// all excited, upset or whiny about life. /// I prefer a unit like Spock - no emotion, pure intellect and analysis. /// Just give me the facts. Still, I need to fix the code. public abstract class Human extends Animal{ public Integer alive; // might as well use Maslow's hierarchy here: // physiological needs array: // breathing, food, water, sex, sleep, homeostasis, excretion public Boolean physiological[]; // safety/security array: // body, employment, resources, morality, the family, health, property public Boolean security[]; // love/belonging array: // friendship, family, sexual intimacy public Boolean love[]; // esteem array: // self esteem, confidence, achievement, respect of others, respect by others public Boolean esteem[]; // self-actualization array: // morality, creativity, spontaneity, problem solving, lack of prejudice, acceptance of facts public Integer selfActualized[]; // constructor method called for each new Human public Human() { // TODO Auto-generated constructor stub alive = 10; } abstract void sick(); abstract void eats(); abstract void drinks(); abstract void sleeps(); abstract Boolean breathes(); abstract Boolean maintainsHomeostasis(); public void lives(){ while(alive!=0){ } } public static void main(String[] args) { // maybe do adam and eve sample here? } // OK. Rewriting code to provide a cognitive affective response // to a perceived event. Note: this response is purely mental, but could // trigger other dimensions of emotions such as behavioral (e.g. fight or // flight) or physiological (e.g. sweaty hands, dry mouth, dilated // pupils, or rapid heart rate). (Roseman's 1982 taxonomy of emotions) Public String emotionalResponse(Event e){ // get an A on a test if (e.agent == SELF && e.outcome == POSITIVE) { if (e.deserve == TRUE) { return "Pride":} else return "Guilt";} // cheated // got caught cheating and failed test if (e.agent == SELF && e.outcome == NEGATIVE) { if (e.deserve == TRUE) { return "Guilt";} else return "Regret";} // failed: did not study // girlfriend/boyfriend agreed to move in if (e.agent == OTHER && e.outcome == POSITIVE) { if (e.importance == HIGH) { return "Love"} else return "Like";} // brother moved in // girlfriend/boyfriend unfaithful if (e.agent == OTHER && e.outcome == NEGATIVE) { if (e.importance == HIGH) { return "Hate"} else return "Dislike";} // brother drank my beer // won lottery if (e.agent == CIRCUMSTANCES && e.outcome == POSITIVE) { if (e.certain == TRUE) { return "Joy"} else return "Hope";} // bought lottery ticket // diagnosed with cancer if (e.agent == CIRCUMSTANCES && e.outcome == NEGATIVE) { if (e.certain == TRUE) { return "Distress"} else return "Fear";} // need test for tumor } } // note: emotional response is the same for both male and female versions // is that a bug or a feature? /// I am not sure that my manager will be able to appreciate this. /// He did not agree to give me time off when my mother was sick. /// I wish my girlfriend were still around. She might actually /// be able to help me debug the code.