Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor tweaks to Kotlin quickstart after nullity annotations #627

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TimeTableConstraintProvider : ConstraintProvider {
// ... and penalize each pair with a hard weight.
.penalize(HardSoftScore.ONE_HARD)
.justifyWith { lesson1: Lesson, lesson2: Lesson, _ ->
RoomConflictJustification(lesson1.room, lesson1,lesson2)
RoomConflictJustification(lesson1.room!!, lesson1, lesson2)
}
.asConstraint("Room conflict")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import org.acme.kotlin.schooltimetabling.domain.Room


data class RoomConflictJustification(
val room: Room?,
val room: Room,
val lesson1: Lesson,
val lesson2: Lesson,
val description: String
) :
ConstraintJustification {

constructor(
room: Room?,
room: Room,
lesson1: Lesson,
lesson2: Lesson
) : this(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TimetableEnvironmentTest {
solve(EnvironmentMode.FAST_ASSERT)
}

fun solve(environmentMode: EnvironmentMode?) {
fun solve(environmentMode: EnvironmentMode) {
// Load the problem
val problem: Timetable = given()
.`when`()["/demo-data/SMALL"]
Expand All @@ -39,12 +39,10 @@ class TimetableEnvironmentTest {
.extract()
.`as`(Timetable::class.java)

// Update the environment
// Update the environment
val updatedConfig = solverConfig!!.copyConfig()
updatedConfig.withEnvironmentMode(environmentMode)
.withTerminationSpentLimit(Duration.ofSeconds(30))
.terminationConfig.withBestScoreLimit(null)
.withEnvironmentMode(environmentMode)
val solverFactory: SolverFactory<Timetable> = SolverFactory.create(updatedConfig)

// Solve the problem
Expand Down
Loading