-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-structure input json #6
Comments
Proposed schema{
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Welcome2",
"definitions": {
"Welcome2": {
"type": "object",
"additionalProperties": false,
"properties": {
"resource_profiles": {
"type": "array",
"items": {
"$ref": "#/definitions/ResourceProfile"
}
},
"arrival_time_distribution": {
"$ref": "#/definitions/ArrivalTimeDistribution"
},
"arrival_time_calendar": {
"$ref": "#/definitions/ArrivalTimeCalendar"
},
"gateway_branching_probabilities": {
"type": "array",
"items": {
"$ref": "#/definitions/GatewayBranchingProbability"
}
},
"task_resource_distribution": {
"type": "array",
"items": {
"$ref": "#/definitions/TaskResourceDistribution"
}
},
"resource_calendars": {
"type": "array",
"items": {
"$ref": "#/definitions/ResourceCalendar"
}
}
},
"required": [
"arrival_time_calendar",
"arrival_time_distribution",
"gateway_branching_probabilities",
"resource_calendars",
"resource_profiles",
"task_resource_distribution"
],
"title": "Welcome2"
},
"ArrivalTimeDistribution": {
"type": "object",
"additionalProperties": false,
"properties": {
"distribution_name": {
"type": "string"
},
"distribution_params": {
"type": "array",
"items": {
"$ref": "#/definitions/DistributionParam"
}
}
},
"required": [
"distribution_name",
"distribution_params"
],
"title": "ArrivalTimeDistribution"
},
"DistributionParam": {
"type": "object",
"additionalProperties": false,
"properties": {
"value": {
"type": "number"
}
},
"required": [
"value"
],
"title": "DistributionParam"
},
"GatewayBranchingProbability": {
"type": "object",
"additionalProperties": false,
"properties": {
"gateway_id": {
"type": "string"
},
"probabilities": {
"type": "array",
"items": {
"$ref": "#/definitions/Probability"
}
}
},
"required": [
"gateway_id",
"probabilities"
],
"title": "GatewayBranchingProbability"
},
"Probability": {
"type": "object",
"additionalProperties": false,
"properties": {
"path_id": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"path_id",
"value"
],
"title": "Probability"
},
"ResourceCalendar": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"time_periods": {
"type": "array",
"items": {
"$ref": "#/definitions/ArrivalTimeCalendar"
}
}
},
"required": [
"id",
"name",
"time_periods"
],
"title": "ResourceCalendar"
},
"ArrivalTimeCalendar": {
"type": "object",
"additionalProperties": false,
"properties": {
"from": {
"type": "string"
},
"to": {
"type": "string"
},
"beginTime": {
"type": "string",
"format": "time"
},
"endTime": {
"type": "string",
"format": "time"
}
},
"required": [
"beginTime",
"endTime",
"from",
"to"
],
"title": "ArrivalTimeCalendar"
},
"ResourceProfile": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"resource_list": {
"type": "array",
"items": {
"$ref": "#/definitions/ResourceList"
}
}
},
"required": [
"id",
"name",
"resource_list"
],
"title": "ResourceProfile"
},
"ResourceList": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"cost_per_hour": {
"type": "string",
"format": "integer"
},
"amount": {
"type": "integer"
},
"calendar": {
"type": "string"
},
"assignedTasks": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"amount",
"assignedTasks",
"calendar",
"cost_per_hour",
"id",
"name"
],
"title": "ResourceList"
},
"TaskResourceDistribution": {
"type": "object",
"additionalProperties": false,
"properties": {
"task_id": {
"type": "string"
},
"resources": {
"type": "array",
"items": {
"$ref": "#/definitions/Resource"
}
}
},
"required": [
"resources",
"task_id"
],
"title": "TaskResourceDistribution"
},
"Resource": {
"type": "object",
"additionalProperties": false,
"properties": {
"resource_id": {
"type": "string"
},
"distribution_name": {
"type": "string"
},
"distribution_params": {
"type": "array",
"items": {
"$ref": "#/definitions/DistributionParam"
}
}
},
"required": [
"distribution_name",
"distribution_params",
"resource_id"
],
"title": "Resource"
}
}
}
|
Example of the implemented new JSON{
"resource_profiles": [
{
"id": "sid-A6F8AB76-7589-4280-A833-B353A4238C38",
"name": "Credit Officer",
"resource_list": [
{
"id": "sid-A6F8AB76-7589-4280-A833-B353A4238C38_1",
"name": "Credit Officer_1",
"cost_per_hour": "35",
"amount": 1,
"calendar": "sid-222A1118-4766-43B2-A004-7DADE521982D",
"assignedTasks": ["sid-622A1118-4766-43B2-A004-7DADE521982D", "sid-622A1118-4766-43B2-A004-7DADE521982D"]
},
{
"id": "sid-A6F8AB76-7589-4280-A833-B353A4238C38_2",
"name": "Credit Officer_2",
"cost_per_hour": "35",
"amount": 1,
"calendar": "sid-222A1118-4766-43B2-A004-7DADE521982D",
"assignedTasks": ["sid-622A1118-4766-43B2-A004-7DADE521982D"]
}
]
},
{
"id": "sid-09FFCEBC-C60F-40D8-8AE7-2C4CB5DCF798",
"name": "Clerk",
"resource_list": [
{
"id": "sid-09FFCEBC-C60F-40D8-8AE7-2C4CB5DCF798_1",
"name": "Clerk_1",
"cost_per_hour": "25",
"amount": 1,
"calendar": "sid-222A1118-4766-43B2-A004-7DADE521982D",
"assignedTasks": []
},
{
"id": "sid-09FFCEBC-C60F-40D8-8AE7-2C4CB5DCF798_2",
"name": "Clerk_2",
"cost_per_hour": "25",
"amount": 1,
"calendar": "sid-222A1118-4766-43B2-A004-7DADE521982D",
"assignedTasks": []
}
]
},
{
"id": "sid-13AFF558-4B56-4722-A649-AE8CCAFC2EC7",
"name": "System",
"resource_list": [
{
"id": "sid-13AFF558-4B56-4722-A649-AE8CCAFC2EC7_1",
"name": "System_1",
"cost_per_hour": "25",
"amount": 1,
"calendar": "sid-222A1118-4766-43B2-A004-7DADE521982D",
"assignedTasks": []
}
]
}
],
"arrival_time_distribution": {
"distribution_name": "expon",
"distribution_params": [
{ "value": 0 },
{ "value": 1800.0 },
{ "value": 90.0 }
]
},
"arrival_time_calendar": {
"from": "MONDAY",
"to": "FRIDAY",
"beginTime": "09:00:00.000",
"endTime": "17:00:00.000"
},
"gateway_branching_probabilities": [
{
"gateway_id": "sid-64FC5B46-47E5-4940-A0AF-ECE87483967D",
"probabilities": [
{
"path_id": "sid-8AE82A7B-75EE-401B-8ABE-279FB05A3946",
"value": "0.7"
},
{
"path_id": "sid-789335C6-205C-4A03-9AD6-9655893C1FFB",
"value": "0.3"
}
]
},
{
"gateway_id": "sid-FACFF0AE-6A1B-47AC-B289-F5E60CB12B2A",
"probabilities": [
{
"path_id": "sid-AFEC7074-8C12-43E2-A1FE-87D5CEF395C8",
"value": "0.3"
},
{
"path_id": "sid-AE313010-5715-438C-AD61-1C02F03DCF77",
"value": "0.7"
}
]
}
],
"task_resource_distribution": [
{
"task_id": "sid-622A1118-4766-43B2-A004-7DADE521982D",
"resources": [
{
"resource_id": "sid-A6F8AB76-7589-4280-A833-B353A4238C38_1",
"distribution_name": "norm",
"distribution_params": [
{ "value": 600.0 },
{ "value": 120.0 }
]
},
{
"resource_id": "sid-A6F8AB76-7589-4280-A833-B353A4238C38_2",
"distribution_name": "norm",
"distribution_params": [
{ "value": 60.0 },
{ "value": 12.0 }
]
}
]
}
],
"resource_calendars": [
{
"id": "sid-222A1118-4766-43B2-A004-7DADE521982D",
"name": "calendar1",
"time_periods": [
{
"from": "MONDAY",
"to": "FRIDAY",
"beginTime": "09:00:00.000",
"endTime": "17:00:00.000"
},
{
"from": "SATURDAY",
"to": "SATURDAY",
"beginTime": "09:00:00.000",
"endTime": "13:00:00.000"
}
]
}
]
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: