You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0624]: associated function `time` is private
--> src/lib.rs:14:56
|
14 | while sim.scheduler.peek().map_or(false, |e| e.time() < self.limit) {
| ^^^^ private associated function
|
::: C:\Users\patatas\.cargo\registry\src\jackfan.us.kg-1ecc6299db9ec823\simrs-0.2.0\src\scheduler.rs:55:5
|
55 | pub(crate) fn time(&self) -> Duration {
| ------------------------------------- private associated function defined here
For more information about this error, try `rustc --explain E0624`.
For context I'm comparing models between some simulation libraries one of those libraries only let's you define a limit and it will stop if the simulation time is >= to the limit imposed. The Executor provided instead will continue the simulation until time > limit
For context I'm comparing models between simulation libraries, one of those libraries let's you define a limit in term of seconds and it will stop the simulation if time >= limit meanwhile the Executor provided will execute the simulation while e.time() <= time remains true (from the execute_until code) this causes that the same model can produce different results because in one library it will execute less events than the other (that does happens to me) so I decided to implement my own executor by implementing Execute following a simplified version of the one in the library sadly it doesn't compile because it tried to access a private method.
This is not grave to me because this can be adapted to
but ideally the version using Execute should compile.
EDIT: I just realized I could just do the above in the Executor too... Well that's why I get for trying to copy the source code :D
The text was updated successfully, but these errors were encountered:
Thanks for submitting this @PatatasDelPapa Glad you found a workaround. It's true that making the method public would fix the compilation, but I'm not entirely sure I want that. I need to revisit this carefully before making the decision.
The thing is that this event type is a piece of internal machinery, and I'd like to close as much of it as possible. It might be better to, say, add a next_time method to the scheduler for example, that would return an optional.
In fact, I'd love to make EventEntry totally hidden from the user, but I'm not sure that's possible... Need to experiment.
I followed the code of execute_until for my onw Executor to this adaptation and it will not compile
it produces the following error
For context I'm comparing models between some simulation libraries one of those libraries only let's you define a limit and it will stop if the simulation time is >= to the limit imposed. The
Executor
provided instead will continue the simulation until time > limitFor context I'm comparing models between simulation libraries, one of those libraries let's you define a limit in term of seconds and it will stop the simulation if
time >= limit
meanwhile theExecutor
provided will execute the simulation whilee.time() <= time
remainstrue
(from the execute_until code) this causes that the same model can produce different results because in one library it will execute less events than the other (that does happens to me) so I decided to implement my own executor by implementingExecute
following a simplified version of the one in the library sadly it doesn't compile because it tried to access a private method.This is not grave to me because this can be adapted to
but ideally the version using
Execute
should compile.EDIT: I just realized I could just do the above in the Executor too... Well that's why I get for trying to copy the source code :D
The text was updated successfully, but these errors were encountered: