giulioforesto / planets

A 2D plotted planets movement simulator
0 stars 0 forks source link

Output file format #4

Closed gabrielfougeron closed 9 years ago

gabrielfougeron commented 10 years ago

I copied the format of you two (short and long) tests. Check if file format is ok.

New variables Is it a problem if I add new variables in the output format (e.g. total energy) ? Do I have to somehow "tell" you, or isthe JSON format conveniant enought that it allows you to discard them ? (until needed)

Order New lines should be added at the beginning of the file. See testCases.md on branch plotter for more details.

If necessary, see http://stackoverflow.com/questions/7110616/fortran-how-to-write-data-to-specific-line-in-the-file.

giulioforesto commented 10 years ago

You can add all what you want provided that the <key,value> I need remain (x, t and m for the moment).

I will be able at any moment to parse new variables you would have added to the output file.

giulioforesto commented 10 years ago

Output file at https://github.com/giulioforesto/planets/blob/master/Planets-simulator/output/outfile.txt is almost ok. But for x and m I need them to be:

{
    "t": <long>,
    "x": {
        "id1": [<float>, <float>],
        "id2": [<float>, <float>]
    },
    "m": {
        "id2": <float>
    }
}
gabrielfougeron commented 10 years ago

Print output routine updated.

Cannot unfortunately write new line at the beginning of file without overwriting the current line

giulioforesto commented 10 years ago

Gonna try to read backwards then.

http://stackoverflow.com/a/11665098/3636525

Hang tight...

gabrielfougeron commented 9 years ago

Remember that a "refresh" function might provide an easy (and totally fine) work-arround

giulioforesto commented 9 years ago

I should be able to read backwards, need file example to test.
Otherwise, non-live representation or refresh feature are possible, so the issue about the writing order will be closed as soon as I can check the revised output file example.

Edit: output file is ok. live-representation issues must be discussed in new issue.