Our state of the art Gantt chart


Post by Jerther »

nickolay wrote:The duration of the task is increased only by the intervals, which are "working" in the task's own calendar and in the calendar of at least one assigned resource.
Oh, that last condition is critical. Now I get it. I think once the issues you're working on are fixed, I'll be able to build a working calendar structure.

Can't wait to test your fixes :)

Post by nickolay »

Ok, with this dataset:
{
	"success": true,
	"type": "load",
	"project": {
		"name": "Year 20XX",
		"startDate": "2020-04-01 00:00:00",
		"calendar" : 1
	},
	"tasks": {
		"rows": [{
			"id": 77,
			"name": "Eat all the potatoes!",
			"startDate": "2020-04-02 00:00:00",
			"endDate": "2020-04-03 12:00:00",
			"duration": 1.333333333,
			"constraintDate": "2020-04-02 00:00:00",
			"manuallyScheduled": false,
			"rollup": false,
			"initiallyExpanded": true,
			"effortDriven": true,
			"constraintType": "startnoearlierthan",
			"effortUnit": "hour",
			"schedulingMode": "FixedUnits",
			"expanded": true,
			"effort": 72.0,
			"percentDone": 0,
			"children": []
		}]
	},
	"resources": {
		"rows": [{
			"id": 15,
			"name": "Doris Cole",
			"calendar": "resource_15"
		}, {
			"id": 19,
			"name": "Eli Lambert",
			"calendar": "resource_19"
		}, {
			"id": 18,
			"name": "Ernest Reed",
			"calendar": "resource_18"
		}]
	},
	"assignments": {
		"rows": [{
			"id": 133,
			"resource": 15,
			"event": 77,
			"units": 100
		}, {
			"id": 134,
			"resource": 19,
			"event": 77,
			"units": 100
		}, {
			"id": 135,
			"resource": 18,
			"event": 77,
			"units": 100
		}]
	},
	"calendars": {
		"rows": [{
			"id": 2,
			"name": "Evening shift",
			"hoursPerDay": 8.0,
			"daysPerWeek": 5,
			"daysPerMonth": 20,
			"unspecifiedTimeIsWorking": false,
			"intervals": [{
				"recurrentStartDate": "on monday at 18:00",
				"recurrentEndDate": "on monday at 22:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on tuesday at 18:00",
				"recurrentEndDate": "on tuesday at 22:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on wednesday at 18:00",
				"recurrentEndDate": "on wednesday at 22:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on thursday at 18:00",
				"recurrentEndDate": "on thursday at 22:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on friday at 18:00",
				"recurrentEndDate": "on friday at 22:00",
				"isWorking": true
			}],
			"children": [{
				"id": "resource_15",
				"name": "Doris Cole",
				"unspecifiedTimeIsWorking": false,
				"intervals": []
			}]
		}, {
			"id": 1,
			"name": "Standard 40 Hours/Week",
			"hoursPerDay": 8.0,
			"daysPerWeek": 5,
			"daysPerMonth": 20,
			"unspecifiedTimeIsWorking": false,
			"intervals": [{
				"recurrentStartDate": "on monday at 8:00",
				"recurrentEndDate": "on monday at 12:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on monday at 13:00",
				"recurrentEndDate": "on monday at 17:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on tuesday at 8:00",
				"recurrentEndDate": "on tuesday at 12:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on tuesday at 13:00",
				"recurrentEndDate": "on tuesday at 17:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on wednesday at 8:00",
				"recurrentEndDate": "on wednesday at 12:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on wednesday at 13:00",
				"recurrentEndDate": "on wednesday at 17:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on thursday at 8:00",
				"recurrentEndDate": "on thursday at 12:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on thursday at 13:00",
				"recurrentEndDate": "on thursday at 17:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on friday at 8:00",
				"recurrentEndDate": "on friday at 12:00",
				"isWorking": true
			}, {
				"recurrentStartDate": "on friday at 13:00",
				"recurrentEndDate": "on friday at 17:00",
				"isWorking": true
			}, {
				"startDate": "2020-04-03 00:00:00",
				"endDate": "2020-04-04 00:00:00",
				"isWorking": false
			}],
			"children": [{
				"id": "resource_19",
				"name": "Eli Lambert",
				"unspecifiedTimeIsWorking": false,
				"intervals": []
			}, {
				"id": "resource_18",
				"name": "Ernest Reed",
				"unspecifiedTimeIsWorking": false,
				"intervals": [{
					"startDate": "2020-04-02 00:00:00",
					"endDate": "2020-04-04 00:00:00",
					"isWorking": false
				}]
			}]
		}]
	}
}
start date of the task: Apr 02 2020 08:00:00
end date of the task: Apr 09 2020 17:00:00
duration of the task: 5d (40 hours)

- Task is using calendar 1, "inherited" from the project
- Moved the "holiday" in the calendar1 to April (previously was in May)
- resource 15 does not contribute any effort at all, because it is on the calendar that gives empty intersection with the task calendar
- 04/02 - 04/03 - 8 hours of effort, contributed by resource_18, 8 hours of duration
- 04/03 - 04/04 - 0 hours of effort, 0 hours of duration - "holiday" in the calendar1
- 04/04 - 04/06 - 0 hours of effort, 0 hours of duration - weekend
- 04/06 - 04/09 - 16 * 3 hours of effort, contributed by resource_18, resource_19, 8 * 3 hours of duration
- 04/09 - 04/10 - 16 hours of effort, contributed by resource_18, resource_19, 8 hours of duration
- in total, 8 + 16 * 3 + 16 = 72h effort, 8 + 8 * 3 + 8 = 40h duration
- Duration conversion uses calendar 1
- "unspecifiedTimeIsWorking": false for all child calendars (important)

Still have few tests to fix, which are unrelated to scheduling modes, then the integration tests. Hopefully will be merged early-mid next week and will be available in nightly builds.

Post by nickolay »

The branch with the fix has been merged, please try to reproduce the issue in the tomorrow nightly build.

Post by Jerther »

Using 2020-05-06-next I get an error saying Bundle included twice. setVersion('gantt', '2.1.2'); is indeed called twice (duplicated line) so I just removed one of them and then it loads fine. Then using the data in your previous post, I get Error: Invalid start date.

Using 2020-05-06-release it starts ok but when I switch tabs in the task editor I always get the same fields so I can't get the Advanced tab fields. But I can fiddle with the effort field and check the behavior.

So for 72 hours effort, the scheduler says the task should end on april 9th at 17h00. Let's check that :geek:

April 2nd: Ernest is off, that leaves Eli for 8 hours (day) and Doris for 4 hours (evening) = 12 hours. 60 hours left to do.
April 3rd: Day shift is off. That leaves Doris for 4 hours (evening) = 4 hours. 56 hours left to do.
April 4th and 5th are week end
April 6th: Everyone works so Eli and Ernest 8 hours each (day), plus Doris for 4 hours (evening) = 20 hours. 36 hours left to do.
April 7th, Everyone works so Eli and Ernest 8 hours each (day), plus Doris for 4 hours (evening) = 20 hours. 16 hours left to do.
April 8th, Everyone works but for the 16 remaining hours, the day shift is sufficient: Eli and Ernest 8 hours each (day) = 16 hours. 0 hours to do at 17h00.

So the task should end on April 8th at 17h00.

If I reduce the effort, I can see the problem is in the first few days. Let's say 14 hours. The scheduler says the task should end on april 6th at 11h00. Hmm that's odd. Let's see:

April 2nd: Ernest is off, that leaves Eli for 8 hours (day) and Doris for 4 hours (evening) = 12 hours. 2 hours left to do.
April 3rd: Day shift is off. That leaves Doris for 4 hours (evening) but only 2 hours are left to do so task ends at 20h00.

So the task should end on April 3rd at 20h00.

Does that make sens?

EDIT

Oh I get it now.
resource 15 does not contribute any effort at all, because it is on the calendar that gives empty intersection with the task calendar
With that in mind, the results are ok. I'll have to think of another way to setup the calendar tree. I'll do some tests.

Post by Jerther »

Alright if I add a top level calendar with full availability, like this:
Project calendar with 24/24 365/365 availability
  |-- Day shift
      |-- Ernest's Calendar
      |-- Eli's Calendar
  |-- Evening shift
      |-- Doris' Calendar
Then the scheduler works as I expect!!! :D

I noticed something though. The task is set to fixed units and effort driven. If I postpone the start date, the effort increases! I don't believe that's intended, is it?

Post by nickolay »

Then the scheduler works as I expect!!! :D
Cool-cool :)
I noticed something though. The task is set to fixed units and effort driven. If I postpone the start date, the effort increases! I don't believe that's intended, is it?
Can you provide exact steps to reproduce please?

Post by Jerther »

Sure!

Here's the data:
{
	"success": true,
	"type": "load",
	"project": {
		"name": "Year 20XX",
		"startDate": "2020-04-01 00:00:00",
		"calendar" : 3
	},
	"tasks": {
		"rows": [{
			"id": 77,
			"name": "Eat all the potatoes!",
			"startDate": "2020-04-02 00:00:00",
			"endDate": "2020-04-03 12:00:00",
			"duration": 1.333333333,
			"constraintDate": "2020-04-02 00:00:00",
			"manuallyScheduled": false,
			"rollup": false,
			"initiallyExpanded": true,
			"effortDriven": true,
			"constraintType": "startnoearlierthan",
			"effortUnit": "hour",
			"schedulingMode": "FixedUnits",
			"expanded": true,
			"effort": 72.0,
			"percentDone": 0,
			"children": []
		}]
	},
	"resources": {
		"rows": [{
			"id": 15,
			"name": "Doris Cole",
			"calendar": "resource_15"
		}, {
			"id": 19,
			"name": "Eli Lambert",
			"calendar": "resource_19"
		}, {
			"id": 18,
			"name": "Ernest Reed",
			"calendar": "resource_18"
		}]
	},
	"assignments": {
		"rows": [{
			"id": 133,
			"resource": 15,
			"event": 77,
			"units": 100
		}, {
			"id": 134,
			"resource": 19,
			"event": 77,
			"units": 100
		}, {
			"id": 135,
			"resource": 18,
			"event": 77,
			"units": 100
		}]
	},
	"calendars": {
		"rows": [{
			"id": 3,
			"name": "Base calendar",
			"hoursPerDay": 8.0,
			"daysPerWeek": 5,
			"daysPerMonth": 20,
			"children": [{
				"id": 2,
				"name": "Evening shift",
				"hoursPerDay": 8.0,
				"daysPerWeek": 5,
				"daysPerMonth": 20,
				"unspecifiedTimeIsWorking": false,
				"intervals": [{
					"recurrentStartDate": "on monday at 18:00",
					"recurrentEndDate": "on monday at 22:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on tuesday at 18:00",
					"recurrentEndDate": "on tuesday at 22:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on wednesday at 18:00",
					"recurrentEndDate": "on wednesday at 22:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on thursday at 18:00",
					"recurrentEndDate": "on thursday at 22:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on friday at 18:00",
					"recurrentEndDate": "on friday at 22:00",
					"isWorking": true
				}],
				"children": [{
					"id": "resource_15",
					"name": "Doris Cole",
					"unspecifiedTimeIsWorking": false,
					"intervals": []
				}]
			}, {
				"id": 1,
				"name": "Standard 40 Hours/Week",
				"hoursPerDay": 8.0,
				"daysPerWeek": 5,
				"daysPerMonth": 20,
				"unspecifiedTimeIsWorking": false,
				"intervals": [{
					"recurrentStartDate": "on monday at 8:00",
					"recurrentEndDate": "on monday at 12:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on monday at 13:00",
					"recurrentEndDate": "on monday at 17:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on tuesday at 8:00",
					"recurrentEndDate": "on tuesday at 12:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on tuesday at 13:00",
					"recurrentEndDate": "on tuesday at 17:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on wednesday at 8:00",
					"recurrentEndDate": "on wednesday at 12:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on wednesday at 13:00",
					"recurrentEndDate": "on wednesday at 17:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on thursday at 8:00",
					"recurrentEndDate": "on thursday at 12:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on thursday at 13:00",
					"recurrentEndDate": "on thursday at 17:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on friday at 8:00",
					"recurrentEndDate": "on friday at 12:00",
					"isWorking": true
				}, {
					"recurrentStartDate": "on friday at 13:00",
					"recurrentEndDate": "on friday at 17:00",
					"isWorking": true
				}, {
					"startDate": "2020-04-03 00:00:00",
					"endDate": "2020-04-04 00:00:00",
					"isWorking": false
				}],
				"children": [{
					"id": "resource_19",
					"name": "Eli Lambert",
					"unspecifiedTimeIsWorking": false,
					"intervals": []
				}, {
					"id": "resource_18",
					"name": "Ernest Reed",
					"unspecifiedTimeIsWorking": false,
					"intervals": [{
						"startDate": "2020-04-02 00:00:00",
						"endDate": "2020-04-04 00:00:00",
						"isWorking": false
					}]
				}]
			}]
		}]
	}
}
Use 2020-05-06-release

Now edit the task, and simply hit the right arrow on the start date field so it increases one day.

The Effort fields increases from 72 hours to 80.

Should've stayed at 72.

Post by nickolay »


Post by nickolay »

The branch with the fix is merged, you can verify in the tomorrow nightly build.

Post by Jerther »

Looks like the problem is fixed in 2.1.3! :D

Post Reply