排课约束

  • 课程筛选(导入 CSV 时的过滤)

    配置 · course_filter

    软约束
    编码形式
    {
      "excluded_departments": [
        "体育教学部"
      ],
      "excluded_campuses": [
        "03"
      ],
      "experimental_hour_types": [
        "4",
        "5"
      ],
      "experimental_keywords": [
        "实验",
        "实训",
        "实习"
      ],
      "required_course_attr": "1"
    }
  • 教室筛选(导入教室)

    配置 · classroom_filter

    软约束
    编码形式
    {
      "allowed_buildings": [
        "一教",
        "二教",
        "三教",
        "东区主楼",
        "东区老图书馆",
        "信电楼",
        "工院楼",
        "计算中心",
        "新教学楼",
        "旧教学楼",
        "新综合楼",
        "农学楼",
        "土化楼",
        "人发报告厅",
        "旧动医楼",
        "植保",
        "生命科学楼",
        "神内",
        "西区图书馆",
        "西区教室"
      ],
      "required_area_name": "多媒体教室",
      "exclude_parentheses_in_name": true,
      "required_is_available": "1"
    }
  • 时间与节次(大节、断点、工作日)

    配置 · time

    软约束
    编码形式
    {
      "days_per_week": 7,
      "periods_per_day": 6,
      "periods_per_block": 2,
      "weekdays": [
        1,
        2,
        3,
        4,
        5
      ],
      "weekends": [
        6,
        7
      ],
      "block_gaps": [
        [
          2,
          3
        ],
        [
          4,
          5
        ]
      ],
      "block_to_periods": {
        "1": [
          1,
          2
        ],
        "2": [
          3,
          4
        ],
        "3": [
          5,
          6
        ],
        "4": [
          7,
          8
        ],
        "5": [
          9,
          10
        ],
        "6": [
          11,
          12
        ]
      }
    }
  • 默认周次与求解参数

    配置 · misc

    软约束
    编码形式
    {
      "default_weeks": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16
      ],
      "default_consecutive_periods": 2,
      "failed_penalty": 1000,
      "grade_levels": [
        "22",
        "23",
        "24",
        "25"
      ],
      "grade_alias_seed": {
        "大一": "25"
      }
    }
  • 形势与政策最优先,然后水院/工院课设,食院课设次之

    department_priority

    软约束
    编码形式
    {
      "id": "dept_course_design_first",
      "type": "department_priority",
      "description": "形势与政策最优先,然后水院/工院课设,食院课设次之",
      "priority_rules": [
        {
          "match": {
            "course_name_contains": [
              "形势与政策",
              "马克思主义基本原理",
              "毛泽东思想和中国特色社会主义理论体系概论",
              "思想道德与法治",
              "中国近现代史纲要",
              "习近平新时代中国特色社会主义思想概论"
            ]
          },
          "priority": -100
        },
        {
          "match": {
            "department_contains": [
              "水利与土木工程学院",
              "工学院"
            ],
            "course_name_contains": "课程设计"
          },
          "priority": 0
        },
        {
          "match": {
            "department_contains": "食品科学与营养工程学院",
            "course_name_contains": "课程设计"
          },
          "priority": 1
        }
      ],
      "default_priority": 100
    }
  • 标准排序:必修优先、有指定教室优先、大容量优先、连排多优先

    standard

    软约束
    编码形式
    {
      "id": "standard_order",
      "type": "standard",
      "description": "标准排序:必修优先、有指定教室优先、大容量优先、连排多优先",
      "required_first": true,
      "assigned_classroom_first": true,
      "capacity_desc": true,
      "consecutive_blocks_desc": true
    }
  • 必修课不在周六日

    required_weekday_only

    硬约束
    编码形式
    {
      "id": "required_weekday_only",
      "type": "required_weekday_only",
      "hard": true,
      "description": "必修课不在周六日"
    }
  • 军事理论课排晚上(大课5-6,即9-12节)

    course_time_restriction

    硬约束
    编码形式
    {
      "id": "military_theory_evening",
      "type": "course_time_restriction",
      "hard": true,
      "description": "军事理论课排晚上(大课5-6,即9-12节)",
      "match": {
        "course_name_contains": "军事理论"
      },
      "allowed_blocks": [
        5,
        6
      ]
    }
  • 思政课排白天(大课1-4,即1-8节)

    course_time_restriction

    硬约束
    编码形式
    {
      "id": "politics_daytime",
      "type": "course_time_restriction",
      "hard": true,
      "description": "思政课排白天(大课1-4,即1-8节)",
      "match": {
        "course_name_contains": [
          "思想道德与法治",
          "马克思主义基本原理",
          "中国近现代史纲要",
          "毛泽东思想和中国特色社会主义理论体系概论",
          "习近平新时代中国特色社会主义思想概论",
          "形势与政策"
        ]
      },
      "allowed_blocks": [
        1,
        2,
        3,
        4
      ]
    }
  • 思政课教室容量不超过100

    course_capacity_limit

    硬约束
    编码形式
    {
      "id": "politics_capacity_limit",
      "type": "course_capacity_limit",
      "hard": true,
      "description": "思政课教室容量不超过100",
      "match": {
        "course_name_contains": [
          "思想道德与法治",
          "马克思主义基本原理",
          "中国近现代史纲要",
          "毛泽东思想和中国特色社会主义理论体系概论",
          "习近平新时代中国特色社会主义思想概论",
          "形势与政策"
        ]
      },
      "max_capacity": 500
    }
  • 形势与政策跳过教师冲突检查(教师为挂名负责人,不实际授课)

    teacher_conflict_exempt

    硬约束
    编码形式
    {
      "id": "xingshi_teacher_exempt",
      "type": "teacher_conflict_exempt",
      "description": "形势与政策跳过教师冲突检查(教师为挂名负责人,不实际授课)",
      "match": {
        "course_name_contains": "形势与政策"
      }
    }
  • 心理健康课在7-8节(大课4)

    course_time_restriction

    硬约束
    编码形式
    {
      "id": "mental_health_block4",
      "type": "course_time_restriction",
      "hard": true,
      "description": "心理健康课在7-8节(大课4)",
      "match": {
        "course_name_contains": "心理健康"
      },
      "allowed_blocks": [
        4
      ]
    }
  • 植物生理学实验在白天(大课1-4)

    course_time_restriction

    硬约束
    编码形式
    {
      "id": "plant_physiology_lab_day",
      "type": "course_time_restriction",
      "hard": true,
      "description": "植物生理学实验在白天(大课1-4)",
      "match": {
        "course_name_contains": "植物生理学实验"
      },
      "allowed_blocks": [
        1,
        2,
        3,
        4
      ]
    }
  • 课程必须在指定校区上课,西区的课在西区,东区的课在东区

    course_campus_match

    硬约束
    编码形式
    {
      "id": "course_campus_match",
      "type": "course_campus_match",
      "hard": true,
      "description": "课程必须在指定校区上课,西区的课在西区,东区的课在东区"
    }
  • 教师不能跨校区上课(资环学院和土院专业选修课豁免)

    teacher_no_cross_campus

    硬约束
    编码形式
    {
      "id": "teacher_no_cross_campus",
      "type": "teacher_no_cross_campus",
      "hard": true,
      "description": "教师不能跨校区上课(资环学院和土院专业选修课豁免)",
      "exclude_departments": [
        "资源与环境学院",
        "土地科学与技术学院"
      ]
    }
  • 大一大二英语选课时段预留(周二/四/五上午,三天中至少留1天有空大节)

    time_slot_reservation

    硬约束
    编码形式
    {
      "id": "english_reservation",
      "type": "time_slot_reservation",
      "hard": true,
      "description": "大一大二英语选课时段预留(周二/四/五上午,三天中至少留1天有空大节)",
      "reserved_days": [
        2,
        4,
        5
      ],
      "reserved_blocks": [
        1,
        2
      ],
      "min_free_days": 1,
      "exclude_match": {
        "course_name_contains": [
          "英语",
          "形势与政策",
          "马克思主义基本原理",
          "毛泽东思想和中国特色社会主义理论体系概论",
          "思想道德与法治",
          "中国近现代史纲要",
          "习近平新时代中国特色社会主义思想概论"
        ]
      },
      "apply_to_class_patterns": [
        "25",
        "24"
      ]
    }
  • 有物理实验课的班级周一至周五下午至少留1个时段(大课3-4)

    time_slot_reservation

    硬约束
    编码形式
    {
      "id": "physics_lab_reservation",
      "type": "time_slot_reservation",
      "hard": true,
      "description": "有物理实验课的班级周一至周五下午至少留1个时段(大课3-4)",
      "reserved_days": [
        1,
        2,
        3,
        4,
        5
      ],
      "reserved_blocks": [
        3,
        4
      ],
      "min_free_slots": 1,
      "exclude_match": {
        "course_name_contains": [
          "物理实验"
        ]
      }
    }
  • 一周两次的课隔天,且不要安排在周一和周五

    course_interval

    软约束
    编码形式
    {
      "id": "interval_2_per_week",
      "type": "course_interval",
      "hard": false,
      "description": "一周两次的课隔天,且不要安排在周一和周五",
      "times_per_week": 2,
      "min_interval_days": 2,
      "forbidden_day_combos": [
        [
          1,
          5
        ]
      ],
      "penalty": 200
    }
  • 一周三次的课隔天

    course_interval

    软约束
    编码形式
    {
      "id": "interval_3_per_week",
      "type": "course_interval",
      "hard": false,
      "description": "一周三次的课隔天",
      "times_per_week": 3,
      "min_interval_days": 1,
      "penalty": 200
    }
  • 基础生物化学实验课连着两天(周五周六)

    consecutive_day_course

    硬约束
    编码形式
    {
      "id": "biochem_lab_consecutive",
      "type": "consecutive_day_course",
      "hard": true,
      "description": "基础生物化学实验课连着两天(周五周六)",
      "match": {
        "course_name_contains": "基础生物化学"
      },
      "consecutive_days": 2,
      "preferred_start_day": 5
    }
  • 时段偏好:减少早8、晚课和周末(思政课不受早8惩罚)

    day_time_preference

    软约束
    编码形式
    {
      "id": "day_time_preference",
      "type": "day_time_preference",
      "hard": false,
      "description": "时段偏好:减少早8、晚课和周末(思政课不受早8惩罚)",
      "block1_penalty": 10,
      "late_block_penalty": 50,
      "weekend_penalty": 100,
      "block1_exempt_match": {
        "course_name_contains": [
          "形势与政策",
          "马克思主义基本原理",
          "毛泽东思想和中国特色社会主义理论体系概论",
          "思想道德与法治",
          "中国近现代史纲要",
          "习近平新时代中国特色社会主义思想概论"
        ]
      }
    }
  • 形势与政策:避免扎堆周一第一大节,并在各星期/大节上尽量均匀

    course_time_spread

    软约束
    编码形式
    {
      "id": "situation_policy_time_spread",
      "type": "course_time_spread",
      "hard": false,
      "description": "形势与政策:避免扎堆周一第一大节,并在各星期/大节上尽量均匀",
      "match": {
        "course_name_contains": "形势与政策"
      },
      "monday_block1_penalty": 24,
      "monday_penalty": 0,
      "same_slot_density_penalty": 12
    }
  • 大一周五下午不上课

    course_time_restriction

    硬约束
    编码形式
    {
      "type": "course_time_restriction",
      "id": "user_freshman_no_friday_afternoon",
      "description": "大一周五下午不上课",
      "hard": true,
      "match": {
        "class_group_contains": "25"
      },
      "forbidden_days": [
        5
      ],
      "forbidden_blocks": [
        3,
        4
      ]
    }
  • 大一周五下午不上课

    course_time_restriction

    硬约束
    编码形式
    {
      "type": "course_time_restriction",
      "id": "user_freshman_no_friday_afternoon",
      "description": "大一周五下午不上课",
      "hard": true,
      "match": {
        "class_group_contains": "25"
      },
      "forbidden_days": [
        5
      ],
      "forbidden_blocks": [
        3,
        4
      ]
    }

补充或修改说明

直接写下希望增加、取消或例外的安排即可,不必按固定格式填写。

Enter 发送 · Shift+Enter 换行