~opencog-dev/embodiment-mv1.5-proxy/trunk

« back to all changes in this revision

Viewing changes to server/src/com/vettalabs/petaverse/plugins/PetaversePhysiologicalModel.java

  • Committer: Zhenhua Cai
  • Date: 2011-05-16 10:30:15 UTC
  • Revision ID: czhedu@gmail.com-20110516103015-oezpd5kv4hz5j1jv
make physiological levels change quickly

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    /**
42
42
     * Constants used by processCommand method
43
43
     */
44
 
        private static double IDLE_ENERGY_DECREASE_RATE = -0.000001;
45
 
        private static double SLEEP_ENERGY_INCREASE_RATE = 0.000005; 
46
 
        private static double STARVING_ENERGY_DECREASE_RATE = -0.000002;
 
44
        private static double IDLE_ENERGY_DECREASE_RATE = -0.00001;
 
45
        private static double SLEEP_ENERGY_INCREASE_RATE = 0.00005; 
 
46
        private static double STARVING_ENERGY_DECREASE_RATE = -0.00002;
47
47
 
48
 
    private static double EAT_ENERGY_INCREASE = 0.2; 
 
48
    private static double EAT_ENERGY_INCREASE = 0.15; 
49
49
    private static double EAT_POO_INCREASE = 0.05;
50
 
    private static double DRINK_THIRST_DECREASE = 0.01; 
 
50
    private static double DRINK_THIRST_DECREASE = 0.15; 
51
51
    private static double DRINK_PEE_INCREASE = 0.05; 
52
52
        
53
53
        /**
55
55
         */
56
56
        private static long MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000; 
57
57
 
58
 
    private static double INITIAL_FITNESS = 1.0;
59
 
    private static double INITIAL_ENERGY = 0.9;
 
58
    private static double INITIAL_FITNESS = 0.85;
 
59
    private static double INITIAL_ENERGY = 0.85;
60
60
 
61
61
    /**
62
62
     * Getters/ Setters of monitored state variables
170
170
     */
171
171
    public void processCommand(PetAction petAction){
172
172
        // If the pet is in bad situation (i.e. lower fitness), each action would cost more energy
173
 
        double cost = (1.5 - this.fitness) * actionCost(petAction) / 1.5; 
 
173
        double cost = (1.5 - this.fitness) * actionCost(petAction) * 10 / 1.5; 
174
174
        this.energy -= cost;
175
175
        this.energy = this.zeroOneCut(this.energy); 
176
176
 
457
457
        this.energy = INITIAL_ENERGY;
458
458
 
459
459
        this.hunger = 1 - this.energy;       
460
 
        this.thirst = 0;       
461
 
        this.peeUrgency = 0;
462
 
        this.pooUrgency = 0;
 
460
        this.thirst = 0.35;       
 
461
        this.peeUrgency = 0.35;
 
462
        this.pooUrgency = 0.35;
463
463
    }
464
464
 
465
465
}