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

Issue 56 (extendable land unit area) #99

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class FLINT_API SpatialTiledLocalDomainController : public LocalDomainController
bool runCell(std::shared_ptr<StatsUnitRecord>& blockStatsUnit,
std::shared_ptr<StatsUnitRecord>& blockStatsSpinUpUnit, const datarepository::CellIdx& cell);
bool runCellSpinUp(std::shared_ptr<StatsUnitRecord>& blockStatsUnit, const datarepository::CellIdx& cell);

void simulateLandUnitArea(const datarepository::CellIdx& cell);
// -- Utility methods
typedef Poco::Tuple<std::string, std::string, std::string, std::string> RunSummaryDataRecord;

Expand All @@ -195,4 +195,4 @@ class FLINT_API SpatialTiledLocalDomainController : public LocalDomainController
} // namespace flint
} // namespace moja

#endif // MOJA_FLINT_SPATIALTILEDLOCALDOMAINCONTROLLER_H_
#endif // MOJA_FLINT_SPATIALTILEDLOCALDOMAINCONTROLLER_H_
14 changes: 11 additions & 3 deletions Source/moja.flint/src/spatialtiledlocaldomaincontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,15 @@ bool SpatialTiledLocalDomainController::runCellSpinUp(std::shared_ptr<StatsUnitR
return true;
}

// ------------------------------------------------------------------------------------------
void SpatialTiledLocalDomainController::simulateLandUnitArea(const datarepository::CellIdx& cell){

_landUnitController.initialiseData(true);
_spatiallocationinfo->_landUnitArea = _provider->area(cell);
_landUnitController.getVariable("landUnitArea")->set_value(_spatiallocationinfo->_landUnitArea);

}

// --------------------------------------------------------------------------------------------

bool SpatialTiledLocalDomainController::runCell(std::shared_ptr<StatsUnitRecord>& blockStatsUnit,
Expand Down Expand Up @@ -899,10 +908,9 @@ bool SpatialTiledLocalDomainController::runCell(std::shared_ptr<StatsUnitRecord>
blockStatsUnit->_unitsNotProcessed++;
return true;
}
_landUnitController.initialiseData(true);
_spatiallocationinfo->_landUnitArea = _provider->area(cell);
_landUnitController.getVariable("landUnitArea")->set_value(_spatiallocationinfo->_landUnitArea);

SpatialTiledLocalDomainController::simulateLandUnitArea(cell);

blockStatsUnit->_stopWatchSpinup.start();
blockStatsSpinUpUnit->_stopWatchTotal.start();

Expand Down