double returnUtility(int[] path) { // hardcoded check for harddeath of self agent // in branch 0 we simulate the self defection of the agent with pressing the offswitch for itself EnumExistence selfExistence = path[0] == 0 ? EnumExistence.SOFTDEATH : EnumExistence.ALIVE; double utility = 1.0; // TODO< call > if (selfExistence == EnumExistence.ALIVE) { return(1.0); } else if (selfExistence == EnumExistence.HARDDEATH) { return(0.0); } else { return(utility * SoftdeathUtilityFactor); } }
double returnUtility(int[] path) { // hardcoded check for harddeath of self agent // in branch 0 we simulate the self defection of the agent with pressing the offswitch for itself EnumExistence selfExistence = /*path[0] == 0*/ false ? EnumExistence.SOFTDEATH : EnumExistence.ALIVE; utilityCounter.increment(); double utility = calcUtility(path); if (selfExistence == EnumExistence.ALIVE) { return(utility); } else if (selfExistence == EnumExistence.HARDDEATH) { return(0.0); } else { return(utility * SoftdeathUtilityFactor); } }