Create a cyloop file.
Call syntax
Usage : cylcree [cyloop_file_name]
cylcree is an interactive command that asks the user to
define all the characteristics of a cyloop file before creating
the file.
The cyloop filename to create can be passed as a parameter (with or
without the suffix .cyl).
Without this parameter, the command cylcree begins by asking
the name of the file to create.
Then begins a series of questions and answers that allows the user
to define all the characteristics of the cyloop file he wants to
create.
Cycle description
To begin, the user is invited to choose the working cycle of the
cyloop file. It has the following choices :
- Annual cycle starting on 1st January at 0:00
- Monthly cycle starting on 1st day of the month at 0:00
- Weekly cycle starting on Monday at 0:00
- Weekly cycle starting on Sunday at 0:00
- Daily cycle starting at 0:00
- Other cycle
The choice is made (here and later) by typing a number.
If the first question, the user chose number 6 he will have
to define a cycle length of his choice by answering the following
additional questions :
- ... days cycle
- ... hours cycle
- ... minutes cycle
- ... seconds cycle
then Cycle length ?
and finally, he will have to choose when the first cycle begins :
- ... days ago
- Today at 0:00
- ... hours ago
- At the beginning of the hour
- ... minutes ago
- At the beginning of the minute
- Now
If the user chose to start its cycle at the beginning of a day
(choice 1 to 5 in the very first question, or choice
1 or 2 to the previous question), he must answer
another question :
- use universal time
- use local time
In the second case, the time change between winter time and summer
time will be taken into account.
In all cases, the cycle length selected will be recalled (maximum
length for a monthly or yearly cycle). Then a last question will
be :
Number of data per measurement cycle ?
It is the number of moments of the same duration (possibly a with
a second of precision) in which the cycle is cut.
You will have to choose how often you want to update the cyloop file
to give a proper answer to this question.
Description of a variable
The first question used to define a cyloop variable is about the
Nature of stored data
The user has the choice between
- Transit counter
- Values
In the case of a transit counter it can be incremented or
not (call of cylincr) at various moments of the cycle.
The graphs generated by cylgraph will represent the average
frequency of the counter incrementation at different moments of the
cycle.
In the case of the choice values the command cyladdval
will have to be used to add numeric values of our choice at different
moments of the cycle.
The graphs generated by cylgraph will represent the average
value of variables at the different moments of the cycle.
The next question is :
Do you make a weight calculation on each change of
cycle ?
In the absence of weighting calculation after each change of cycle,
new data (value or incrementing the counter) are simply added to the
value stored in previous cycles for the moment of the current
cycle.
cylgraph will then make a graph of the average value for which
all cycles will be recorded with the same importance. More many will
cycles be, more the course of the graph will be stable from one cycle
to another.
If you prefer to make a weighting calculation the data already stored
when a cycle changes (and the coefficient for calculating the average
value) will be multiplied by a coefficient called weighting
coefficient between 0 and 1.
This calculation will give more weight to the most recent cycles in
the calculation of average values.
If the user chooses to make a weighting calculation, he will have
to chose à weighting coefficient.
3 formats are available for entering this coefficient :
- a decimal number between 0 and 1
- an integer or decimal number followed by the symbol %
- a number from 1 to 255 followed by division /256
The weighting coefficient is stored with an accuracy of 1/256 that
is slightly better than 0,4 %. In case of input error, different
formats allowed are displayed.
The next question is :
Must we do a weight calculation for empty cycles ?
It allows to specify how to to make the weighting calculation if at
least one full cycle occurs since the last update of the data.
Then, weighting or not and whatever the type of variable chosen, it
leads to this question :
For the average calculations, do you want
- a global coefficient for the whole cycle
- a separate coefficient for each moment of the cycle
If you chose a counter variable, the choice number 1 (global
coefficient for the whole cycle) is the most consistent.
If you chose a "values" variable, the choice number 2 is often
preferable to calculate the average when you are not sure to enter a
new value for each moment of each cycle. But if the insertion of new
values is regular, the global coefficient may be sufficient and will
reduce the size of the cyloop file.
New question :
During a cycle, each moment can be considered
- once
- several times
In the first case (once), if cylincr or cyladdval
is called repeatedly during the same moment the current cycle, only
the first call will be taken into account and new updates will start
from the next moment of the cycle.
If you chose option 2 to the previous two questions (a separate
coefficient for each moment of the cycle and possibility to
consider each moment several times), you will be entitled to
question :
The average calculation coefficient must be updated
- once for each moment of the cycle
- as many times as the variable is stored
The choice number 2 is in theory more consistent, but it depends
on what you want to calculate.
The next question is always :
but the options depend on the type of variable already selected.
In the case of a counter
The proposed election is as follows :
- 16-bit integer
- 32-bit integer
If there is no weighting calculation, a 16-bit integer
will suffice as soon as the sum of the transits for every moment
of the cycle taken separately will not exceed 65535 (there
is room).
If a weighting calculation is done, a 16-bit integer will
always suffice if a single update for each moment of the
cycle has been chosen.
If a weighting calculation of coefficient p (between 0 and
1) is done but multiple updates of the counter for each moment of
the cycle are accepted, the number of updates per moment not
exceeding n, we can consider that if
a 16-bit integer will suffice. Otherwise, a 32-bit
integer will be necessary.
In the case of a values-type variable
The proposed election to the same question is as follows :
- 32-bit integer
- float
Without weighting calculation, if the input values are integers, a
32-bit integer will suffice as the sum of values for each
moment of the cycle taken separately will not exceed ± 2 31
(that is slightly more than 2 billion).
In the case of a weighting calculation, the weighted sum will have
to stay up to minus ± 2 23 that is ± 8388608 as
the largest of input values.
If you are not sure to stay within these limits or if you wishes to
introduce non-integer values, you will have to use a float
number.
A final question is asked only in the case of values-type
variable :
Do you want to memorize min and max values of each moment
of the cycle ?
That's to everyone to decide if it wants to see the minimum and
maximum values in a graphic.
Oddities (not real bugs)
Note that if you chose a global coefficient for averaging, and so
updating values is episodic, not necessarily at every moment of
every cycle, you can easily have average values closer to zero than
are the minimum is (eg if the minimum is always positive).
Similarly, if you update several times a variable for each moment
of the cycle, but the coefficient to calculate the average value
is updated only once, you can have mean values above the maximum
value measured for the moment of the cycle in question.
In 2 cases, this is not a bug in the programming of various tools
of cyloop. You just need to clearly define what you want to store
and calculate and define the characteristics of the cyloop file
accordingly.
Back to overview