org.cpsolver.studentsct

## Class OnlineSectProof.StudentSequence

- java.lang.Object
- - org.cpsolver.studentsct.OnlineSectProof.Sequence
  - - org.cpsolver.studentsct.OnlineSectProof.StudentSequence

- Enclosing class:
    OnlineSectProof

      public static class OnlineSectProof.StudentSequence
      extends OnlineSectProof.Sequence

  Extension of `OnlineSectProof.Sequence` that represents an ordered set of students as they are to be enrolled into a course (given set of sections).

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StudentSequence(int[] columns)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `allow(int x, int col)` Check whether it is possible to allow student of given type into the given section.
    `boolean` | `check()` Check that the underlying sequence is a valid sequence of students.
    `int` | `limit(int col)` Limit of a column (section of a course).
    `int` | `maxCnt(int x)` Maximum number of student of the given type that can be enrolled into the provided sections (i.e., sum of limits of sections that are allowed fot the student of the given type, see `allow(int, int)`).
    `int` | `nrAllow(int x)` Number of sections into which a student of a given type can be enrolled (see `allow(int, int)` ).
    `int` | `nrColumns()`

    - ### Methods inherited from class org.cpsolver.studentsct.OnlineSectProof.Sequence

      `base, cat, count, inc, progress, seq, set, size, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### StudentSequence

          public StudentSequence(int[] columns)

      Constructor
      Parameters:
        `columns` - limits of sections of a course (e.g., new int[] {5, 10} for two sections, first of the size 5, second of the size of 10)

  - ### Method Detail

    - #### nrColumns

          public int nrColumns()

    - #### limit

          public int limit(int col)

      Limit of a column (section of a course).
      Parameters:
        `col` - column
      Returns:
        limit

    - #### check

          public boolean check()

      Check that the underlying sequence is a valid sequence of students. I.e., that each student can be enrolled into a section.
      Returns:
        true, if valid

    - #### allow

          public boolean allow(int x,
                               int col)

      Check whether it is possible to allow student of given type into the given section. Student type can be seen as a binary string that has 1 for each section into which a student can be enrolled. I.e., student of type 0 can be enrolled into the fist section, type 2 into the second section, type 3 into both first and section section, type 4 into the third section, type 5 into the first and third section etc.
      Parameters:
        `x` - type
        `col` - section
      Returns:
        allowed

    - #### nrAllow

          public int nrAllow(int x)

      Number of sections into which a student of a given type can be enrolled (see `allow(int, int)` ).
      Parameters:
        `x` - type
      Returns:
        number of sections

    - #### maxCnt

          public int maxCnt(int x)

      Maximum number of student of the given type that can be enrolled into the provided sections (i.e., sum of limits of sections that are allowed fot the student of the given type, see `allow(int, int)`).
      Parameters:
        `x` - type
      Returns:
        maximal number of students