bool IsSmallerU(I_SingleCandidate other_can, I_Agent agent) { int req_u = Math.Abs(other_can.CanIndex); int obs_u = Math.Abs(agent.ReceiveGreenCounts - agent.ReceiveRedCounts); return((obs_u >= req_u) ? true : false); }
bool IsBiggerWeight(I_SingleCandidate select_can, I_SingleCandidate other_can) { double other_canwei = other_can.CanWeight; double select_canwei = select_can.CanWeight; return((other_canwei >= select_canwei) ? true : false); }
bool IsEvsOpinionFormed(I_Agent agent, I_SingleCandidate select_can, I_SingleCandidate other_can) { bool evs1 = this.IsDetermined(agent) && this.IsBiggerWeight(select_can, other_can); bool evs2 = this.IsSmallerU(other_can, agent) && (other_can.CanWeight != select_can.CanWeight); return(evs1 || evs2); }
bool IsEvsOpinionFormed(I_Agent agent, I_SingleCandidate select_can, I_SingleCandidate other_can, I_CandidateSet canset) { bool evs1 = this.IsChanged(agent) && this.IsBiggerWeight(select_can, other_can); bool evs2 = this.IsBigWeightOfReqU(other_can, agent, canset); return(evs1 || evs2); }
bool IsBigWeightOfReqU(I_SingleCandidate other_can, I_Agent agent, I_CandidateSet canset) { int obs_u = Math.Abs(agent.ReceiveGreenCounts - agent.ReceiveRedCounts); if (obs_u <= 0) { obs_u = Math.Abs(canset.SingleCandidateList.OrderBy(can => can.CanWeight).Last().CanIndex); } if (obs_u > canset.SingleCandidateList.OrderBy(can => can.CanIndex).Last().CanIndex) { obs_u = Math.Abs(canset.SingleCandidateList.OrderBy(can => can.CanWeight).First().CanIndex); } double req_w = canset.SingleCandidateList.Where(can => Math.Abs(can.CanIndex) == obs_u).Select(can => can.CanWeight).Min(); double other_w = other_can.CanWeight; return((other_w >= req_w) ? true : false); }