// Player doLogic() parameter recording segment |
//Overrides Experiment doLogic in Pogamut Library to add db recording |
@Override //doLogic() to capture player movement and position |
protected void doLogic() throws PogamutException { |
long time System.currentTimeMillis(); //Time of current execution |
if (time − lastSaveTime > 60000) { |
dbConn.Insert (“tbl_PParams”,time, vel, dir, loc); //Update Player Table |
lastSaveTimetime; } //Set data recording interval |
totalTS++; |
Triple vel getMemory().getAgentVelocity(); //Player velocity |
Triple dir getMemory().getAgentRotation(); //Player movement direction |
Triple loc getMemory().getAgentLocation(); //Player postion |
if (vel.x ! 0 vel.y ! 0) { //the player is moving |
wasImmo false; |
} else { //the player is not moving |
if (wasImmo) { |
consecImmoTS; } |
wasImmo true; |
immoTS; } |
|
} |
//BOT doLogic() parameter recording segment |
protected void doLogic() throws PogamutException { |
long time System.currentTimeMillis(); //Time of current execution |
if (time − lastSaveTime > 60000) { |
dbConn.Insert (“tbl_BParams”, time, vel, dir, loc); //Update BOT Table |
lastSaveTimetime; } //Set data recording interval |
totalTS; |
Triple vel memory.getAgentVelocity(); //BOT velocity |
Triple dir memory.getAgentRotation(); //BOT movement direction |
Triple loc memory.getAgentLocation(); //BOT position |
if (vel.x ! 0 vel.y ! 0) { //the BOT is moving |
wasImmo false; |
} else { //the BOT is not moving |
if (wasImmo) { |
consecImmoTS; } |
wasImmo true; |
immoTS; } |
|
action_run_roamAround(); //BOT Path following Navigation command |
}
|