R : How to have combinations that match requirements [closed]

偶尔善良 提交于 2020-03-16 10:00:43

问题


I have a dataframe with courses ("courses") and the number of hours the course is teached for a year ("hours")

my problem is that for each course, i have to choose someone to teach it. every teacher have a profil which are either : "Perm", "Vac", "temp", "other" The amount of hours teach a year (the sum of all hours) must be given by at least :

90% of ("Perm" + "Vac" + temp), 50% of ("Vac"+ "temp") and 20% of "temp". Is it possible to have combinations of which profile should teach which course to match the requirements ?

my dataframe would look like that.

Course   Hours  combination1 combination2
course1   200   ?             ?
course2   50    ?             ?
course3   150   ?             ?
course4   220   ?             ?
course5   25    ?             ?

in that exemple, at least :

129 hours should be teach by "temp" teachers

322,5 hours should be teach by "Vac" or "temp" teachers

580,5 hours should be teach by "Temp", "Vac" or "perm" teachers

Is it possible ?

来源:https://stackoverflow.com/questions/60614199/r-how-to-have-combinations-that-match-requirements

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!