//public IList<StationDay> Days { get; set; }
 public Constraint(Group group, uint? groupRank, IList<Station> stations,
     uint? minVisits, uint? maxVisits, uint? priority)
 {
     Group = group;
     GroupRank = groupRank;
     Stations = stations;
     MinVisits = minVisits;
     MaxVisits = maxVisits;
     Priority = priority;
 }
        private static int score(Dictionary<int, int>[,] masterSchedule, Station S, Group G, int Day, int Slot)
        {
            int ret = 0;

            int i, j;

            // check if other constraints will be violated if this assignment happens.

            // station cap - 1 for the current assigmment
            int stationIndex = getStationIndex(S);
            int stationTotalAvailableSlotsLeft = S.totalAvailabltSlots - StationAssignmentsCounts[stationIndex] - 1;

            int otherGroupsNeedThisStation = 0;

            if (stationTotalAvailableSlotsLeft < 0)
                throw new Exception("Error generating schedule. SC-1");

            // look for anyone else who wants this station.
            for (i = 0; i < AllConstraints.Count; i++)
            {
                if (ConstraintMet[i] || AllConstraints[i].S != S || AllConstraints[i].G == G)
                    continue;

                otherGroupsNeedThisStation++;
            }

            if (otherGroupsNeedThisStation > stationTotalAvailableSlotsLeft)
            {
                ret += CONSTRAINT_PENALTY * (otherGroupsNeedThisStation - stationTotalAvailableSlotsLeft);
            }

            int nFirstPicks = 0;
            int nSecondPicks = 0;
            int nThirdPicks = 0;
            int nNoPicks = 0;

            // Check how many groups get their second pick instead of first, and how many groups aren't getting any picks

            // Copy the total assignment count for stations.
            int[] StationAssignmentsCountsTemp = (int[])StationAssignmentsCounts.Clone();
            StationAssignmentsCountsTemp[stationIndex]++;

            int stationPick1AvailableSlots, stationPick2AvailableSlots, stationPick3AvailableSlots;

            for (i = 0; i < AllGroups.Count; i++)
            {
                if( AllGroups[i].StationPick1 == -1 )
                    continue;

                stationPick1AvailableSlots = AllGroups[i].StationPick1 == -1 ? 0 : AllStations[AllGroups[i].StationPick1].totalAvailabltSlots - StationAssignmentsCountsTemp[AllGroups[i].StationPick1];
                stationPick2AvailableSlots = AllGroups[i].StationPick2 == -1 ? 0 : AllStations[AllGroups[i].StationPick2].totalAvailabltSlots - StationAssignmentsCountsTemp[AllGroups[i].StationPick2];
                stationPick3AvailableSlots = AllGroups[i].StationPick3 == -1 ? 0 : AllStations[AllGroups[i].StationPick3].totalAvailabltSlots - StationAssignmentsCountsTemp[AllGroups[i].StationPick3];

                if (AllGroups[i].StationPick1 != -1 && stationPick1AvailableSlots > 0)
                {
                    StationAssignmentsCountsTemp[AllGroups[i].StationPick1]++;
                    nFirstPicks++;
                }
                else if (AllGroups[i].StationPick1 != -1 && stationPick2AvailableSlots > 0)
                {
                    StationAssignmentsCountsTemp[AllGroups[i].StationPick2]++;
                    nSecondPicks++;
                }
                else if (AllGroups[i].StationPick1 != -1 && stationPick3AvailableSlots > 0)
                {
                    StationAssignmentsCountsTemp[AllGroups[i].StationPick3]++;
                    nThirdPicks++;
                }
                else
                    nNoPicks++;
            }

            ret += GETTING_SECOND_PICK_PENALTY * nSecondPicks;
            ret += GETTING_THIRD_PICK_PENALTY * nThirdPicks;
            ret += NOT_GETTING_ANY_PICKS_PENALTY * nNoPicks;

            return ret;
        }
 public Constraint(Group g, Station s, int n)
 {
     G = g;
     S = s;
     nTimes = n;
 }
 public Assignment(Group g, Station s)
 {
     G = g;
     S = s;
 }