From 91a1ad1947c8727a84b067e853bc2b98b79cc942 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 1 May 2023 22:05:03 +1200 Subject: [PATCH] Fix bug in log_every_seconds (#597) --- Project.toml | 2 +- docs/src/changelog.md | 6 ++++++ src/algorithm.jl | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 4af334644..6bf3d5ed1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SDDP" uuid = "f4570300-c277-11e8-125c-4912f86ce65d" authors = ["Oscar Dowson "] -version = "1.2.0" +version = "1.2.1" [deps] Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" diff --git a/docs/src/changelog.md b/docs/src/changelog.md index 7275fa9ce..9d2f662cc 100644 --- a/docs/src/changelog.md +++ b/docs/src/changelog.md @@ -7,6 +7,12 @@ CurrentModule = SDDP The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v1.2.1 (May 1, 2023) + +### Fixed + + - Fixed `log_every_seconds` (#597) + ## v1.2.0 (May 1, 2023) ### Added diff --git a/src/algorithm.jl b/src/algorithm.jl index 5d7bea9f3..73970c70e 100644 --- a/src/algorithm.jl +++ b/src/algorithm.jl @@ -950,7 +950,7 @@ function train( if mod(length(log), log_frequency) != 0 return false end - if length(log) >= 2 + if length(log) >= 2 && log_every_seconds > 0.0 return div(log[end-1].time, log_every_seconds) < div(log[end].time, log_every_seconds) end