Capac 2.4.0
Whats this?
This is a human resource optimization tool.
Terminology
- Product - An item which is individually handled during the process.
- Phase - Part of the project. Contains products.
- Department - A product creation step. For example: welding, surface treatment etc.
Date capacity input
The optimization relies on two information. The date capacity is one of them, it represents the human resource capacity date by date in hours and departments. The following example presents the input in json format:
{
"StartDate": "2022-02-01",
"DefaultDepartmentCapacities": [
[ 8, 8, 8 ], //Monday
[ 8, 8, 8 ],
[ 8, 8, 8 ],
[ 8, 8, 8 ],
[ 8, 8, 8 ],
[ 8, 8, 8 ],
[ 8, 8, 8 ]
],
"ExceptionalDepartmentCapacities": {
"2022-02-11T00:00:00":[0,0,0]
}
}
The JSON represents a CapacDateInformation object. The model is defined under Capac.Model namespace. Example of a date capacity calculator input:
CapacDateInformation capacities = ...;
Phases input
The second necessary information for the calculation is the phase data. It contains the phase information for optimization. The following example shows the phase list definition in JSON format containing only the required parameters for the calculation. Additional parameters can be added. The 0 value in HoursInDepartments list has a dedicated functionality. If 0 is set at a department index the product will be skipped. It means that the department not handles the product, instead it will be automatically transported to the next department.
{
"Name": "Project1",
"Id": "Project1",
"Description": "leiras",
"Priority": 1,
"Deadline": "2022.10.30 08:00",
"MaterialAvailability": "2022.10.24 08:34",
"DesignAvailability": "2022.10.24 08:34",
"Phases": {
"Project1-Fázis1": {
"Name": "Project1-Fázis1",
"Id": "Project1-Fázis1",
"Description": "leiras",
"Priority": 1,
"Deadline": "2022.10.30 08:00",
"MaterialAvailability": "2022.10.24 08:34",
"DesignAvailability": "2022.10.24 08:34",
"Products": {
"Project1-Fázis1-1": {
"Id": "Project1-Fázis1-1",
"Weight": 2.0,
"HoursPerTonInDepartments": [ 3.5, 0, 0.5 ]
},
"Project1-Fázis1-2": {
"Id": "Project1-Fázis1-2",
"Weight": 4.0,
"HoursPerTonInDepartments": [ 9.0, 4.05, 0.5 ]
},
"Project1-Fázis1-3": {
"Id": "Project1-Fázis1-3",
"Weight": 1.0,
"HoursPerTonInDepartments": [ 8.0, 4.5, 0.5 ]
},
"Project1-Fázis1-4": {
"Id": "Project1-Fázis1-4",
"Weight": 1.5,
"HoursPerTonInDepartments": [ 2.0, 4.5, 4.5 ]
}
}
},
"Project1-Fázis2": {
"Name": "Project1-Fázis2",
"Id": "Project1-Fázis2",
"Description": "leiras",
"Priority": 1,
"Deadline": "2022.11.26 08:00",
"MaterialAvailability": "2022.10.23 08:34",
"DesignAvailability": "2022.10.23 08:34",
"Weight": 5,
"FinishedWeights": [ 1, 0, 0 ],
"OutsourceDeadlines": [ "2022.12.10 08:00", null, null ],
"OutsourcedWeights": [ 1.0, 0.0, 0.0 ],
"Products": {
"Project1-Fázis2-1": {
"Id": "Project1-Fázis2-1",
"Weight": 1.0,
"HoursPerTonInDepartments": [ 0.5, 0, 0.5 ]
},
"Project1-Fázis2-2": {
"Id": "Project1-Fázis2-2",
"Weight": 1.0,
"HoursPerTonInDepartments": [ 0.5, 0.5, 1.5 ]
},
"Project1-Fázis2-3": {
"Id": "Project1-Fázis2-3",
"Weight": 1.0,
"HoursPerTonInDepartments": [ 2.5, 0.5, 2.0 ]
},
"Project1-Fázis2-4": {
"Id": "Project1-Fázis2-4",
"Weight": 1.0,
"HoursPerTonInDepartments": [ 0.5, 0.05, 2.0 ]
},
"Project1-Fázis2-5": {
"Id": "Project1-Fázis2-5",
"Weight": 1.0,
"HoursPerTonInDepartments": [ 0.5, 2.5, 2.0 ]
}
}
},
"Project1-Fázis3": {
"Name": "Project1-Fázis3",
"Id": "Project1-Fázis3",
"Weight": 5.0,
"Description": "leiras",
"Priority": 1,
"Deadline": "2022.11.26 08:00",
"MaterialAvailability": "2022.10.23 08:34",
"DesignAvailability": "2022.10.23 08:34"
},
}
}
The JSON represents the project as a root Phase object. The model is defined under Capac.Model namespace. Example of a product group list calculator input:
Phase project = ...;
Creating a Capac service
Add Capac service in Startup.cs
builder.Services.AddSingleton<ICapac, Capac>();
Configure
Before calculation the calculator should be configured with the capacities and phases. The configuration is done by calling Configure() function.
calculator.Configure(capacities, project);
Calculation
To trigger calculation based on the given date capacity and product group information simply call the Calculate() funciton of ta Capac instance. Optional calculation parameters are:
- transportDays - the minimum number of days between a department finish time and the next department start time. Default is 2
- ignoreMeterialAvailability - ignore the material availability date. Default is false.
- ignoreDesignAvailability - ignore the design availability date. Default is false.
- outputType - GetResult() function output structure. Default is 1 -- 0 if the output is structured by departments for each day -- 1 if the output is structured by phases for each day
//Calculate and get results with default parameters
calculator.Calculate();
//With parameters
calculator.Calculate(
transportDays: 1,
ignoreMeterialAvailability: true,
ignoreDesignAvailability: true
);
Result data
To get result data initialize the calculator with a CapacityDto object.
new Capac(capacityDto);
The output is a CapacityDto object. The model can be found under Capac.Model namespace. The following example shows the CapacPhaseResult object JSON structure.
{
"Error":null,
"Progress":1.0,
"PhaseSummary":{
"Project1":{
"OptimalDesignAvailability":"2022-09-08T08:00:00",
"OptimalMaterialAvailability":"2022-09-08T08:00:00",
"StartTime":"2022-12-09T20:00:00",
"EndTime":"2023-05-12T20:00:00"
},
"Project1-Fázis1":{
"OptimalDesignAvailability":"2022-12-09T08:00:00",
"OptimalMaterialAvailability":"2022-12-09T08:00:00",
"StartTime":"2022-12-09T20:00:00",
"EndTime":"2023-04-10T20:00:00"
}
},
"Capacities":{
"29/11/2022":{
"RemainingDepartmentHours":[
0.0,
20.0,
10.0
],
"PhaseStatus":{
"Project1-Fázis1":{
"Id":"Project1-Fázis1",
"ItemStatuses":[
{
"Id":"Project1-Fázis1-Fázis1.1",
"ProductionStart":"0001-01-01T00:00:00",
"ProductionEnd":"0001-01-01T00:00:00",
"ProductionCapacity":[
{
"UsedHour":10.0,
"UsedWeight":0.5
},
{
"UsedHour":0.0,
"UsedWeight":0.0
},
{
"UsedHour":0.0,
"UsedWeight":0.0
}
]
}
]
},
"Project1":{
"Id":"Project1",
"ItemStatuses":[
{
"Id":"Project1-Fázis1",
"ProductionStart":"0001-01-01T00:00:00",
"ProductionEnd":"0001-01-01T00:00:00",
"ProductionCapacity":[
{
"UsedHour":10.0,
"UsedWeight":0.5
},
{
"UsedHour":0.0,
"UsedWeight":0.0
},
{
"UsedHour":0.0,
"UsedWeight":0.0
}
]
}
]
}
}
}
}
}
Showing the top 20 packages that depend on Capac.
| Packages | Downloads |
|---|---|
|
Capacc
Capacity cache with calculator
|
1 |
Bug fixes and performance improvements
.NET 6.0
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Caching.Memory (>= 7.0.0)
- NLog (>= 5.0.4)
- Newtonsoft.Json (>= 13.0.1)
- NuGet.Packaging (>= 6.3.1)
| Version | Downloads | Last updated |
|---|---|---|
| 2.4.0 | 1 | 12/10/2025 |