从会员的谷歌文档生成时间表可用性
我有一个谷歌文档电子表格,其中包含有关群组中每个成员是否可以在一周的特定时间见面的信息。一周内需要召开多次会议,小组的不同成员需要参加某些会议。我需要一种方法来生成一个基于此的时间表,以便大多数成员可以参加每次会议。所有会议都不能在同一时间段举行。
该表包含一行代表发生的每个会议。每列代表一个可以举行会议的时间段(例如,周一下午 6:30 至晚上 8:00)。与特定会议和特定时间段对应的单元格包含代表可以参加每个会议的人数的数字。如果单元格包含与注册参加会议的成员数量相同的数字,则 Google 文档会自动突出显示该单元格。
我试图通过使用谷歌文档的脚本功能来解决这个问题,但我在弄清楚算法时遇到了困难。我真正需要的只是一些伪代码,我可以编写它。
假设在我的脚本中,我有一个单元格的二维数组,以及一个与单元格是否突出显示相对应的二维布尔数组(意味着可以出席的最大成员数),
这是表格外观的示例喜欢:
|Meeting |Mon 6:30-8:30pm |Mon 8:30-10:30pm |Tue 6:30-8:30pm |Tue 8:30-10:30pm |
|-----------|----------------|-----------------|----------------|-----------------|
|Meeting 1 |7 |9 |8 |6 |
|Meeting 2 |3 |5 |1 |4 |
|Meeting 3 |10 |15 |12 |8 |
|-----------|----------------|-----------------|----------------|-----------------|
谢谢你的帮助!
I have a google doc spreadsheet that contains information on every member of a group's availability to meet at certain times of the week. There are multiple meetings that need to take place during the week, with different members of the group needing to be at certain meetings. I need a way to generate a schedule based on this such that the most members can attend each meeting. None of the meetings can take place during the same time slot.
The table contains a row for each meeting that takes place. Each column represents a time slot (eg. Mon 6:30pm-8:00pm) that the meetings can take place. The cells corresponding to a certain meeting and a certain time slot contain a number representing the number of people that can attend each meeting. If the cell contains the same number as the number of members signed up for the meeting, then the cell gets highlighted automatically by google docs.
I am trying to solve this problem through the use of google docs' scripting capabilities to do this, but I am having trouble figuring out the algorithm. All I really need is some pseudocode and I can write it.
Assume in my script I have a two-dimensional array of the cells, as well as a two-dimensional boolean array corresponding to whether the cell is highlighted (meaning the maximum members can be in attendance)
Here is an example of what the table looks like:
|Meeting |Mon 6:30-8:30pm |Mon 8:30-10:30pm |Tue 6:30-8:30pm |Tue 8:30-10:30pm |
|-----------|----------------|-----------------|----------------|-----------------|
|Meeting 1 |7 |9 |8 |6 |
|Meeting 2 |3 |5 |1 |4 |
|Meeting 3 |10 |15 |12 |8 |
|-----------|----------------|-----------------|----------------|-----------------|
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设我明白您在说什么,您将必须首先选择安排会议的顺序。我能想到的最好的方法是,考虑到其他一切听起来都是平等的,首先简单地选择最多人可以参加的会议:
之后,查看剩余的会议,看看哪一个会议的出席率最高在当前未安排的日期:
然后迭代,直到所有会议都安排完毕。
Assuming I understand what you're saying, you're going to have to start by choosing the order to schedule the meetings. The best way I can think of, given that it sounds like all else is equal, is to begin by simply choose the meeting which the most people can attend:
After that, look at the remaining meetings and see which one has the highest possible attendance on the currently unscheduled days:
Then just iterate that through until all meetings are scheduled.