Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
dbis
dbis-isochrone
isochrone
Commits
1eaa8138
Commit
1eaa8138
authored
10 years ago
by
User expired
Browse files
Options
Downloads
Patches
Plain Diff
fixed invalid isochrone calculation
added todo
parent
71dc1560
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/it/unibz/inf/isochrone/algorithm/Isochrone.java
+3
-1
3 additions, 1 deletion
...main/java/it/unibz/inf/isochrone/algorithm/Isochrone.java
src/main/java/it/unibz/inf/isochrone/algorithm/MrneX.java
+1
-1
1 addition, 1 deletion
src/main/java/it/unibz/inf/isochrone/algorithm/MrneX.java
with
4 additions
and
2 deletions
src/main/java/it/unibz/inf/isochrone/algorithm/Isochrone.java
+
3
−
1
View file @
1eaa8138
...
@@ -26,6 +26,7 @@ import java.util.Set;
...
@@ -26,6 +26,7 @@ import java.util.Set;
* algorithms which define the loading of the data from the database.
* algorithms which define the loading of the data from the database.
*/
*/
public
abstract
class
Isochrone
{
public
abstract
class
Isochrone
{
private
static
final
double
COMPARE_PRECISION
=
0.0000001d
;
private
final
Query
query
;
private
final
Query
query
;
private
final
PriorityQueue
<
Node
>
queue
;
private
final
PriorityQueue
<
Node
>
queue
;
private
Set
<
Integer
>
codes
;
private
Set
<
Integer
>
codes
;
...
@@ -116,6 +117,7 @@ public abstract class Isochrone {
...
@@ -116,6 +117,7 @@ public abstract class Isochrone {
* @param output the output in which the computed nodes and links are stored.
* @param output the output in which the computed nodes and links are stored.
* @return the computed output (stored in the output given by the parameter)
* @return the computed output (stored in the output given by the parameter)
*/
*/
// TODO: Add some more tests for this method. If isochrone gets too small (2points for 15min isochrone from FUB) nothing fails ;-(
public
<
T
extends
Output
>
T
compute
(
final
T
output
)
{
public
<
T
extends
Output
>
T
compute
(
final
T
output
)
{
output
.
beforeCalculation
();
output
.
beforeCalculation
();
...
@@ -134,7 +136,7 @@ public abstract class Isochrone {
...
@@ -134,7 +136,7 @@ public abstract class Isochrone {
for
(
final
Link
link
:
adjacents
)
{
for
(
final
Link
link
:
adjacents
)
{
if
(
link
.
isContinuous
())
{
if
(
link
.
isContinuous
())
{
updateQueue
(
expandContinuousLink
(
node
,
link
));
updateQueue
(
expandContinuousLink
(
node
,
link
));
if
(
Double
.
valueOf
(
Double
.
MIN_VALUE
).
equals
(
link
.
getStartOffset
())
)
{
if
(
Math
.
abs
(
link
.
getStartOffset
()
-
Double
.
MIN_VALUE
)
<
COMPARE_PRECISION
)
{
output
.
addLink
(
link
);
output
.
addLink
(
link
);
}
}
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/it/unibz/inf/isochrone/algorithm/MrneX.java
+
1
−
1
View file @
1eaa8138
...
@@ -183,7 +183,7 @@ public class MrneX extends Isochrone {
...
@@ -183,7 +183,7 @@ public class MrneX extends Isochrone {
// CHECKSTYLE:OFF MagicNumber
// CHECKSTYLE:OFF MagicNumber
if
(
maxMemory
*
0.95d
<
getNodeSize
())
{
if
(
maxMemory
*
0.95d
<
getNodeSize
())
{
final
double
perc
=
100.0d
-
(
double
)
getNodeSize
()
/
maxMemory
*
100.0d
;
final
double
perc
=
100.0d
-
(
(
double
)
getNodeSize
()
/
maxMemory
)
*
100.0d
;
throw
new
RuntimeException
(
"Free memory size is "
+
NumberFormat
.
getInstance
().
format
(
perc
)
+
"%"
);
throw
new
RuntimeException
(
"Free memory size is "
+
NumberFormat
.
getInstance
().
format
(
perc
)
+
"%"
);
}
}
// CHECKSTYLE:ON MagicNumber
// CHECKSTYLE:ON MagicNumber
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment