/// <summary>アクティビティを定義する</summary> /// <param name="id">ID</param> /// <param name="name">名称</param> /// <param name="externalCost">支出</param> /// <param name="income">収入</param> /// <param name="fixTime">固定時間</param> /// <param name="workLoad">作業量</param> /// <param name="failRate">失敗確率</param> /// <param name="reworkRate">リワーク確率</param> /// <param name="costOverRate">コスト超過確率</param> /// <returns></returns> public static Activity Define( string id = null, string name = null, decimal externalCost = 0m, decimal income = 0m, decimal fixTime = 0m, decimal workLoad = 0m, decimal failRate = 0m, decimal reworkRate = 0m, decimal costOverRate = 0m) { Contract.Requires(!id.IsNullOrEmpty()); Contract.Requires(!name.IsNullOrEmpty()); var activity = new Activity() { Id = id, Name = name, }; activity.Estimate(Cost.Of(externalCost)); activity.Estimate(Income.Of(income)); activity.Estimate(LeadTime.Of(fixTime)); activity.Estimate(WorkLoad.Of(workLoad)); activity.Estimate(Risk.Of(failRate: failRate, reworkRate: reworkRate, costOverRate: costOverRate)); return(activity); }
public static Activity Activity( decimal income = 0m, decimal externalCost = 0m, decimal failRate = 0m, decimal reworkRate = 0m, decimal costoverRate = 0m, State state = State.ToDo, decimal fixTime = 0m, decimal workLoad = 0m, decimal resourceQuantity = 0m, decimal resourceProductivity = 0m ) { var activity = new Activity(); activity.Estimate(Income.Of(income)); activity.Estimate(Cost.Of(externalCost)); activity.Estimate(Risk.Of(failRate, reworkRate, costoverRate)); activity.Estimate(LeadTime.Of(fixTime)); activity.Estimate(WorkLoad.Of(workLoad)); if (resourceQuantity != 0m && resourceProductivity != 0m) { activity.Assign(new[] { Resource.Of(resourceQuantity, resourceProductivity) }); } activity.Progress(state); return(activity); }
public void 見積後のアクティビティのリスクは与えられたものであるべき() { var expectedFailRate = 0.3m; var expectedReworkRate = 0.4m; var expectedCostOverRate = 0.5m; var activity = Activity.Define(); activity.Estimate(Risk.Of(expectedFailRate, expectedReworkRate, expectedCostOverRate)); activity.Risk.FailRate.Is(expectedFailRate); activity.Risk.ReworkRate.Is(expectedReworkRate); activity.Risk.CostOverRate.Is(expectedCostOverRate); }