Learning Curve customization

Sample customization that produces product faster over time based on UDFs.

This guide will review and demonstrate the LearningCurve customization. If you are just getting started, view the following articles for more information on the basics: getting started with customizations.

Overview

This customization is a way to set slower completion times for newer jobs when applicable. This is a good option for if a resource gets faster or produces more over time. The LearningCurve customization allows the user to set the rate at which the future jobs will be faster. 

Demonstration

The customization looks for a UDF called "LearningCurveRate", like the image below, which will be input as a decimal. This UDF specifies the acceleration rate at which the jobs will be completed every time one is scheduled to run that uses the resource with the UDF. 

LearningCurveUDF

The user can create the UDF by selecting an Item in the Inventory Plan screen then clicking on UserFields on the right side of the window.

LearningCurveInventoryPlan

The following code is where the UDF is checked and set. The variable m_startingEfficiency is hardcoded in this code but can be changed to be a UDF.

internal ProductLearningCurve(Item a_item)
{
if (a_item.UserFields.Find(c_udfFieldName)?.DataValue is decimal learningCurveRate)
{
m_rateChange = learningCurveRate;
}

//TODO: Read other properties from additional UDFs
//This sample starts at 50% slower than standard
m_startingEfficiency = 1.5m;
}

The conversion calculation that determines the rate of change is performed in the block of code below. It returns either 1, which represents 100%, or the calculated rate whichever is greater. 

public decimal GetRateModifier()
{
//TODO: Based on parameters, return the appropriate rate modifier for this operation
//This sample returns the starting efficiency + the rate change per scheduled operation and limits the rate to 100% of the standard
decimal rate = m_startingEfficiency - (m_scheduledCount * m_rateChange);
return Math.Max(1, rate); //Limit to 100% of the standard
}

Without the customization

Without the customization, PT will schedule jobs to run at optimal timing by default. From the image below you can see that if the materials are present to complete the job PT will not take any outside variables into account. 

LearningCurveBefore

With the customization

With the customization, the user can define the LearningCurveRate that will determine the percentage of efficiency each new job will gain which will make it faster. 

LearningCurveAfter

Files

Download the Visual Studio project.

Download the customization file for version 11.39.15.

Rename the sample scenario file to scenarios.dat when loading in PlanetTogether.

Download sample scenario.dat file for version 11.39.