/// <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 expectedValue = 100m; var activity = Activity.Define(); activity.Estimate(WorkLoad.Of(expectedValue)); activity.WorkLoad.Value.Is(expectedValue); }
/// <summary>DRAGを求める</summary> /// <returns>DRAG</returns> /// <remarks> /// アクティビティの所要時間をゼロにした場合の完了時間の変化 /// 非クリティカル・パスの場合はゼロ /// クリティカル・パスの場合は並列アクティビティの有無で変化する /// </remarks> public LeadTime Drag() { if (Children.IsNullOrEmpty()) { return(Duration()); } var originalEndTime = Descendants.Where(d => d.Children.IsEmpty()).First().EarliestFinish().Value; var originalFixTime = FixTime; var originalWorkload = WorkLoad; Estimate(LeadTime.Of()); Estimate(WorkLoad.Of()); var shortenedEndTime = Descendants.Where(d => d.Children.IsEmpty()).First().EarliestFinish().Value; var drag = originalEndTime - shortenedEndTime; Estimate(originalFixTime); Estimate(originalWorkload); return(LeadTime.Of(drag)); }
/// <summary>作業量見積</summary> /// <param name="workLoad">作業量</param> public void Estimate(WorkLoad workLoad) { WorkLoad = workLoad; }