Skip to content

Commit

Permalink
Graph of temperature changes for the year in the burg (Azgaar#733)
Browse files Browse the repository at this point in the history
* Option for exporting grid cell (Azgaar#731)

* Added Save Option for Api-like json export.
Will be updated and set to a scheme

* Save Option for Api-like added

* Moved UI of json export to export dialog.
Moved json export to another file named export-json.js

* Added Seperated json export selections
- all JSON : exports all json data.
- minimal JSON : exports json data without cells data.
- cells JSON : exports json data only with pack.cells data.

* More Stable Cell Export...

* Grid cells export option.

* Graph of temperature changes for the year in the burg

I'm bad at writing in English. Please excuse me for this.
It seems illogical to me the parameter of the average temperature for the year in the burg.
Therefore, I found a database of meteorological measurements at https://ru.climate-data.org/
And I analyzed it. With the help of a neural network. I approximately established the dependence of Dy[X] and Dd[X], Md[X] = f(t,p,l).
Dy[X] - how much the temperature in winter differs from the temperature in summer
Md[X] - how much the temperature during the day differs from the temperature at night, on average per year
Dd[X] - how much the temperature difference between day and night is not constant in winter and summer
t - average temperature for the year
p - average rainfall for the year
l - latitude
Now, for each city, you can plot the temperature change. Based on t,p and l.

ATTENTION!!!
The characteristics of the planet and its orbit coincide with those of the earth!

Further, I will use the Russian language, if you want to know my reasoning, please use the Google Translate capabilities.

Я изменил свою первоначальную идею и доработал её. Что касается качества и используемых функций - жду критики. JavaScript - не знакомый мне язык и я не уверен, что выполнил всё верно.
Что касается самой идеи - её реализация пока далека от совершенства. Я понял, что если установить в настройках мира температуру на экваторе ниже, чем на Земле, то графики получаются слишком далекими от реальности. Эта ошибка связана с тем, что Dy[X] зависит от широты, а не среднегодовой температуры. К сожалению добиться хорошей сходимости удалось только расширением нейросети - ещё больше магических чисел.
Теперь, на основе прошлой выборки из 899 городов, попущенных через нейросеть миллион раз среднеквадратичная ошибка стала 3%.
Входными данными для сети являются широта и влажность, а средняя температура иcпользуется только как ориентир при построении графиков.

* Add legnd in graph

* Editing Coefficients

The coefficients have been changed so that the sign of the latitude does not affect the result

Co-authored-by: Efruz Yıldırır <30903352+yldrefruz@users.noreply.github.com>
  • Loading branch information
2 people authored and sofronaspe committed Nov 27, 2022
1 parent 7c09d73 commit 536f9d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/dynamic/export-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ function getPackCellsData() {
religion: Array.from(pack.cells.religion),
province: Array.from(pack.cells.province)
};

const cellObjArr = [];
{
cellConverted.i.forEach(value => {
Expand Down Expand Up @@ -223,3 +222,14 @@ function getPackVerticesData() {
}
return verticesArray;
}

function getGridCellsDataJson() {
TIME && console.time("getGridCellsDataJson");

const info = getMapInfo();
const gridCells = getGridCellsData()
const exportData = {info,gridCells};

TIME && console.log("getGridCellsDataJson");
return JSON.stringify(exportData);
}
5 changes: 5 additions & 0 deletions modules/ui/burg-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ function editBurg(id) {
const id = elSelected.attr("data-id");
showBurgTemperatureGraph(id);
}
function showTemperatureGraphs() {
const id = elSelected.attr("data-id");
showTGForBurg(id);
}


function removeSelectedBurg() {
const id = +elSelected.attr('data-id');
Expand Down

0 comments on commit 536f9d7

Please sign in to comment.