/// <summary> /// Gets all production measurements based the given frame time, work unit information, and the unit completion time. /// </summary> /// <param name="frameTime">The work unit frame time.</param> /// <param name="frames">The number of frames in the work unit.</param> /// <param name="baseCredit">The base credit assigned to the work unit.</param> /// <param name="kFactor">The KFactor assigned to the work unit.</param> /// <param name="preferredDays">The preferred deadline (in decimal days).</param> /// <param name="maximumDays">The final deadline (in decimal days).</param> /// <param name="unitTimeByDownloadTime">The overall unit completion time based on the unit's download time.</param> /// <param name="unitTimeByFrameTime">The overall unit completion time based on the unit's current frame time.</param> /// <returns>The production measurements for the work unit.</returns> public static ProductionValues GetProductionValues(TimeSpan frameTime, int frames, double baseCredit, double kFactor, double preferredDays, double maximumDays, TimeSpan unitTimeByDownloadTime, TimeSpan unitTimeByFrameTime) { var value = new ProductionValues { TimePerFrame = frameTime, BaseCredit = baseCredit, BasePPD = GetPPD(frameTime, frames, baseCredit, kFactor, preferredDays, maximumDays, TimeSpan.Zero), PreferredTime = TimeSpan.FromDays(preferredDays), MaximumTime = TimeSpan.FromDays(maximumDays), KFactor = kFactor, UnitTimeByDownloadTime = unitTimeByDownloadTime, DownloadTimeBonusMulti = GetMultiplier(kFactor, preferredDays, maximumDays, unitTimeByDownloadTime), DownloadTimeBonusCredit = GetCredit(baseCredit, kFactor, preferredDays, maximumDays, unitTimeByDownloadTime), DownloadTimeBonusPPD = GetPPD(frameTime, frames, baseCredit, kFactor, preferredDays, maximumDays, unitTimeByDownloadTime), UnitTimeByFrameTime = unitTimeByFrameTime, FrameTimeBonusMulti = GetMultiplier(kFactor, preferredDays, maximumDays, unitTimeByFrameTime), FrameTimeBonusCredit = GetCredit(baseCredit, kFactor, preferredDays, maximumDays, unitTimeByFrameTime), FrameTimeBonusPPD = GetPPD(frameTime, frames, baseCredit, kFactor, preferredDays, maximumDays, unitTimeByFrameTime) }; return value; }
protected override void OnAwake() { productionValues = GetComponentInParent <HeirarchyNode>().GetComponentInChildren <ProductionValues>(); }
private static string CreateProductionDebugOutput(string project, TimeSpan frameTime, Protein protein, ProductionValues noBonusValues, TimeSpan unitTimeByDownloadTime, ProductionValues bonusByDownloadValues, TimeSpan unitTimeByFrameTime, ProductionValues bonusByFrameValues) { var sb = new StringBuilder(); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " ******* Project: {0} *******", project)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Frames: {0}", protein.Frames)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Credit: {0}", protein.Credit)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " KFactor: {0}", protein.KFactor)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Preferred Time: {0}", TimeSpan.FromDays(protein.PreferredDays))); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Maximum Time: {0}", TimeSpan.FromDays(protein.MaximumDays))); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " **** Production: {0} ****", "No Bonus")); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Frame Time: {0}", frameTime)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " UPD: {0}", noBonusValues.UPD)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " PPD: {0}", noBonusValues.PPD)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " **** Production: {0} ****", "Bonus by Download Time")); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Unit Time: {0}", unitTimeByDownloadTime)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Multi: {0}", bonusByDownloadValues.Multiplier)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Credit: {0}", bonusByDownloadValues.Credit)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " PPD: {0}", bonusByDownloadValues.PPD)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " **** Production: {0} ****", "Bonus by Frame Time")); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Unit Time: {0}", unitTimeByFrameTime)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Multi: {0}", bonusByFrameValues.Multiplier)); sb.AppendLine(String.Format(CultureInfo.CurrentCulture, " Credit: {0}", bonusByFrameValues.Credit)); sb.Append(String.Format(CultureInfo.CurrentCulture, " PPD: {0}", bonusByFrameValues.PPD)); return(sb.ToString()); }