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

Clarify need for start values in input clocks #1066

Closed
clagms opened this issue Jun 17, 2020 · 5 comments
Closed

Clarify need for start values in input clocks #1066

clagms opened this issue Jun 17, 2020 · 5 comments
Assignees
Labels
depends_on_clocks Issues on clocks
Milestone

Comments

@clagms
Copy link
Collaborator

clagms commented Jun 17, 2020

Why do we force the FMU to provide a start value for a clock?

The following description is problematic:

it is required to provide a <<start>> value for describing the expected initial condition of master <<clock,`clocks`>> for that FMU. If an <<inputClock>> has `fmi3True` as an <<start>> value the master should activate the <<clock>> the first time it enters *Event Mode*. The master can nevertheless choose different <<start>> values if it is not possible to fulfill the conditions in a simulation setup.

Because:

  1. For input periodic clocks, the offset, calculated as offset = interval * shiftCounter / resolution, can be zero, therefore the environment will (will it?) know when to execute them (right after initialization), without having the need for a start value for the clock.
  2. For aperiodic input clocks, we cannot think of a usecase for an FMU declaring to the environment that he wants the environment to run one of its input clock right after initialization (plus this demand is not really a demand, as the master can choose to ignore it...)

@KarlWernersson , the working group on clocks need your input on this one.

@chrbertsch chrbertsch added this to the v3.0 milestone Jun 17, 2020
@clagms
Copy link
Collaborator Author

clagms commented Jun 17, 2020

  • We also need to fix the smaller issue.

In case of <> <<inputClock,input clocks>> these values are the start interval values if they are not given by the simulation master.

This depends on the value of strict (as indicated in the subsequent paragraph).

@clagms
Copy link
Collaborator Author

clagms commented Jun 17, 2020

Decision from web meeting 17-06-2020:
drop the start value for ALL clocks.

@chrbertsch
Copy link
Collaborator

Ticket viewing Meeting:

Andreas: I belive we should be able to set values at the beginning and to have start values
Klaus: but we decided otherwise above.
Andreas: I see use cases for virtual ECUs, where it is important to state that a clock shall tick at the beginning. One could overwrite it at the beginning.
TorstenB: In modelica during initialization, no clock ticks. The clock ticks first at eventMode
Klaus: this seems to be a severly different interpretation.
TorstenB: in Modelica during initialization no clock ticks. It first gets active in event mode. There might be requirements from other use cases.
Andreas: We have similar issues with ECU SW ... I will have to look into this.

@andreas-junghanns
Copy link
Contributor

This waits for clarification on clocks and events.

@chrbertsch chrbertsch added the depends_on_clocks Issues on clocks label Oct 5, 2020
andreas-junghanns pushed a commit to andreas-junghanns/fmi-standard that referenced this issue Feb 3, 2021
@andreas-junghanns
Copy link
Contributor

Fixed in #1272.
Changing clocks and Countdown clocks now allow ticks at the first Event Mode.
For periodic clocks, this was always possible.
This will handle the use case for initial tasks of vECUs.

andreas-junghanns added a commit that referenced this issue Feb 9, 2021
* Replace "numeric types" in text with concrete types

* Move Set/GetClock to proper variable section; fix clock type

* Clarify clocks are variables

* Improve diagram to show clocked variables in super-dense time

* Removed most of the clocks section, rewrote parts, moved stuff to attribute definitions

* Changed index in figure to n/n+1

* Fix xrefs

* Remove clockType attribute and all references

* Change strict to interval

* Add Motivation and Concepts of clocks

* Move advancnig time; improve text; move Set/Get entire state

* Fix clock descriptions

* Add shift API

* Add math definition for time-based clocks

* Cleanup TODOs and empty section

* Add qualifier description

* Improve resolution and API description

* Remove useless Representation section

* Remove attribute `periodic`

* Merge ClockType into general types

* Fix inputClock and outputClock references

* Remove useless clock overview table

* Remove special case for input/output clocks in causality description

* Fix a to an

* Remove superfluous section on Clocks in Co-Sim

* xrefs to early-return

* Move code snippet

* Change co-simulation algorithm to importer

* Remove section Clock Support - correct content needs to be in state description

* Revert "Remove section Clock Support - correct content needs to be in state description"

This reverts commit 121cc2d.

* Move counter resolution mechanics to table

* Add Clock type image and link

* Fix double of of

* Move useful part of Sources Directory to proper section and reference to there

* Merge multiple, multiple interface type sections

* Explain information flow for clocks

* Improve example for triggered input clock

* Improve ZIP-description; fold in Source Code description

* Fix chrbertsch comments

* Resort and rename aperiodic clock types

* Remove color coding descriptions; move concepts to state descriptions

* Add math description to Instantiated and Initialization Mode

* Improve description of structuralParameter

* Move fmi3Terminate to proper state; add math description to Config Mode

* Add math table to Terminated, Inititalized, Reconfig Mode

* Cleanup

* Improve Intermediate Update Mode description

* Fix *Event Mode*, started only

* Fix *Event Mode* math++; some formatting

* Finish Event Mode update

* Sort schema sections

* Start fix to Continuous-time Mode

* Finish fixing Cont-Time Mode

* Move sections inside Model Exchange

* Sort Co-Simulation chapter

* Sort Scheduled Execution order

* Fix *Step Mode* description

* Fix appostrophies

* Fir more of CS chapter

* Finish fixing Co-Sim; add earlyReturnAllowed

* Fix Model-Exchange Intro & Concepts

* Fix ME Concepts, started

* Merge a88a399

* Merge 45c32d9

* Finish fixing common concepts still in ME

* Move concepts to general; fix rest

* Move GetContStates and move GetVariables

* Fix clock attributes in xsd; reexport xsd images

* Fix formatting math and indentation

* Fix formatting math and indentation II

* Turn all states to xrefs

* Add many xrefs to arguments and capability flags

* Improve How-to-read-this-document

* Cleanup TODOs

* Turn platform to xref

* Fix figures, remove unused images

* Fix Fraction handling and attributes

* Add definition of model partition and clocked variables; resorted common paragraphs; remove clockReference from xsd

* Add DiscreteTimeState; renamed Derivative to StateDerivative

* Fix formatting in SE

* Turn Enumerations to long in XSD and prescribe proper Get/Set

* Fix min/max handling

* Improve Min-Max descriptions

* Explain multi-Interface FMUs and variable lists

* Generalize routing of IO

* Clarify directly entering CS Event Mode

* Clarify time-event cause

* Add SPDX reference

* Clarify units for function arguments and XML attributes when referring to time

* Update copyright year; Add reference to CCLA

* Fix example XML to use StateDerivative

* Add super-dense time instant to glossary, replace time instance with time instant

* Add non-normative explanation for nValues and nValueReferences

* Fix #1281 going back to FMI 2.0 restrictions.

* Fix #1066

* Add intro to terminals and icons; list in whats-new

* Explain dynamic state selection, including reference

* Add TODO

* Fix umlaut

* First run through SE, add math, fix functions, formatting

* Fix in "before hand" and move clock sentence to clock row in table.

* Start new sentence in non-normalize remark.

* Typo: importer

* Add missing comma.

* Typo: localizing of

* add "... or fmi3ActivateModelPartition"

* intermediateUpdateTime not relevant here

* Adding SE to Definition of Model Variables

* dependencies + SE

* fix clock type

* rm TODO markers

* add clock interval for triggered input

* fix clock interval

* Make clock type description consistent by using the title to start the sentence.

* Remove lone parenthesis and wrong verb.

* Improve English of sentence.

* Fix typo.

* Clarify non-normative text.

* Fixing Christian´s and Claudio´s comments

* Fix (3) and (4) for variability/causality combinations

* Remove (19) in table

* remove todos

* fix typo

* Fixing #1272 (review)

* Add Allowed Function Calls to enter

* Clarify caching

Co-authored-by: Andreas Junghanns <andreas.junghanns@synopsys.com>
Co-authored-by: Claudio Gomes <cla.gms@gmail.com>
Co-authored-by: Matthias Blesken <MatthiasBl@dspace.de>
Co-authored-by: Christian Bertsch <Christian.Bertsch@de.bosch.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends_on_clocks Issues on clocks
Projects
None yet
Development

No branches or pull requests

3 participants