when writeSatisfiedStatus should be occur - scorm

If writeSatisfiedStatus is set to true for local objective, in this case, when should Objective Satisfied Status be copied from local objective to global objective exactly?

As soon as the learner completes a SCO and the LMS trigers the rollup process which sets the value of satisfied status to either true or false.If this does not happen, the value of satisfied status remains null.

Related

qt future isRunning() vs isStarted()

what is the difference between them? from docs, it says "currently running" vs "has been started"?
For example, two thread, one is main, the other is called A.
If currently, main is running, and A started once(). Will A.isRunning() return false? will A.isStarted() return ture?
what if A never starts?
The docs could be clearer. From reading the source code I can see that it enters Started state once, when the function is first run, and that flag doesn't get cleared (even if task is cancelled). So A.isStarted() should return true. isRunning() however is the actual current state, which depends on current progress (eg. !isFinished()), or is false for example if it was paused or cancelled (or caught an exception).

Airflow - is depends_on_past and trigger_rule the same?

In airflow.models.BaseOperator. You have two default parameter:
depends_on_past=False and trigger_rule=u'all_success'
According to doc
depends_on_past (bool) – when set to true, task instances will run sequentially while relying on the previous task’s schedule to succeed.
trigger_rule (str) – defines the rule by which dependencies are applied for the task to get triggered.
Isn't both the same thing ? I don't get why there are redundant parameters.
No, both are entirely different. depends_on_past(boolean) is for to check whether to run a task or not depending on its previous DAG run(last run). trigger_rule is used to trigger a task depends on its parent task(s) state.
refer offical document

Exit flag in pyOptSparseDriver

I need the ability to specify an exit flag if something failed. The OpenMDAO documentation for the pyoptsparse_driver has the option for an exit flag. However, when I run it with an exit flag as an option it says that Option 'exit_flag' has not been added. Also I am also not sure how to actually specify if something failed or not. Would I need to pass the flag out of the component that failed in the solve_nonlinear() and somehow use that to set the option on the pyoptsparse_driver? I want to do something kind of like this but I'm not sure on the syntax and I can't find an example:
def solve_nonlinear(self, params, unknowns, resids):
unknowns['y'], exit_flag = function(params['x'])
self.exit_flag = exit_flag
There are a number of issues here:
1) "How do I propagate failure information from a component up to the optimizer?"
We don't currently have a way of handling this. Its something we'll be working on in the near future though
2) If a component does fail, what is the proper response?
Depends on what you're doing. For a DOE, you should probably just log the failed case and keep going. For a gradient free method, probably some kind of objective penalization is warranted. For a gradient based algorithm, you likely need to back-track on the line-search (or use some other similar kind of walk back mechanism).
3) In the event that it all fails, can the driver report an overall exit status out.
Again, we don't have this implemented yet in a general way. The option you found in pyopt_sparse driver is a mistake in the doc-string. There is an exit_flag attribute that gets set based on the internal pyopt state though.

How to prevent sbt from running a task multiple times in a session?

I'd like to prevent the following task from getting run multiple times when sbt is running:
val myTask = someSettings map {s => if !s.isDone doSomethingAndSetTheFlag}
So what's expected would be when myTask is run for the first time, isDone is false and something gets done in the task, and then the task sets the flag to true. But when the task is run for the second time, since the isDone flag is true, it skips the actual execution block.
The expected behavior is similar to compile -> when source is compiled, the task doesn't compile the code again the next time it's triggered until watchSource task says the code has been changed.
Is it possible? How?
This is done by sbt, a task will be evaluated only once within a single run. If you want to have a value evaluated once, at the project load time, you can change it to be a SettingKey.
This is documented in the sbt documentation (highlighting is mine):
As mentioned in the introduction, a task is evaluated on demand. Each
time sampleTask is invoked, for example, it will print the sum. If the
username changes between runs, stringTask will take different values
in those separate runs. (Within a run, each task is evaluated at
most once.) In contrast, settings are evaluated once on project load
and are fixed until the next reload.

PreCondition or PostCondtion in ACSL

I am not able to distinguish between various precondition and post-condition in ACSL. As I know that requires, terminates and assume comes in precondition and ensures and assigns in post-condition. But in which set rest like decrease etc are??
Can any body is able to help me in figuring out??
thanks in advance
This is a trick question. Basically, decreases would serve as a pre-condition of a recursive call: if you have a function f with decreases x;, if it happens to make a call to itself, you have to prove that x<\at(x,Pre) at this call site. Additionally, you have a pre-condition that x>=0 when you call f (recursive call or not).
Regarding other clauses (based on their order of apperance in ACSL 1.7:
complete and disjoint clause are basically a logical property of the assumes clause of the contract, they do not imply anything for the implementation, but act as a sanity check of the specification itself.
allocates and frees are post-conditions (like for assigns but regarding dynamic allocation)
exits (and returns, breaks and continues) are post-conditions (they are evaluated when we exit the function -or the statement).
dependencies (\from) are post-conditions (like assigns).
decrease clause of ACSL is basically used for recursive function calls.
if you have specified decrease clause with a pointer variable x like: decrease *x;
then what it means is, every time when control enters the function related to this decrease clause, it checks whether the value pointed to by the pointer x is 1 less as compared to the value pointed to by x during the pre-state of the function. For the very first time when the function is called, pre-condition checked is: (*x) >= 0 as the function is in its pre-state so there is no pre-state value to compare to.

Resources