Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
dac434ff
Commit
dac434ff
authored
Jan 12, 2017
by
Marc Schiller
Browse files
Updated models to use doubles instead of longs.
parent
fdd4a4ae
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/views/fiveg/models/ConstantModel.java
View file @
dac434ff
...
...
@@ -28,15 +28,15 @@ package de.tud.kom.p2psim.impl.topology.views.fiveg.models;
*/
public
class
ConstantModel
extends
AbstractModel
{
private
long
c
=
0
;
private
double
c
=
0
;
public
void
setC
(
long
c
)
{
public
void
setC
(
double
c
)
{
this
.
c
=
c
;
}
@Override
public
long
getLong
(
int
users
)
{
return
this
.
c
;
return
(
long
)
this
.
c
;
}
@Override
...
...
src/de/tud/kom/p2psim/impl/topology/views/fiveg/models/CutOffModel.java
View file @
dac434ff
...
...
@@ -27,31 +27,31 @@ package de.tud.kom.p2psim.impl.topology.views.fiveg.models;
*/
public
class
CutOffModel
extends
AbstractModel
{
private
long
a
=
1
;
private
double
a
=
1
;
private
long
b
=
0
;
private
double
b
=
0
;
private
long
c
=
1
;
private
double
c
=
1
;
private
long
d
=
0
;
private
double
d
=
0
;
public
void
setA
(
long
a
)
{
public
void
setA
(
double
a
)
{
this
.
a
=
a
;
}
public
void
setB
(
long
b
)
{
public
void
setB
(
double
b
)
{
this
.
b
=
b
;
}
public
void
setC
(
long
c
)
{
public
void
setC
(
double
c
)
{
this
.
c
=
c
;
}
public
void
setD
(
long
d
)
{
public
void
setD
(
double
d
)
{
this
.
d
=
d
;
}
private
long
heaviside
(
long
x
)
{
private
double
heaviside
(
double
x
)
{
if
(
x
<
0
)
{
return
0
;
}
else
{
...
...
src/de/tud/kom/p2psim/impl/topology/views/fiveg/models/ExponentialModel.java
View file @
dac434ff
...
...
@@ -29,27 +29,27 @@ package de.tud.kom.p2psim.impl.topology.views.fiveg.models;
public
class
ExponentialModel
extends
AbstractModel
{
// exp(u) = a * e ^(c * u + d) + b
private
long
a
=
1
;
private
double
a
=
1
;
private
long
b
=
0
;
private
double
b
=
0
;
private
long
c
=
1
;
private
double
c
=
1
;
private
long
d
=
0
;
private
double
d
=
0
;
public
void
setA
(
long
a
)
{
public
void
setA
(
double
a
)
{
this
.
a
=
a
;
}
public
void
setB
(
long
b
)
{
public
void
setB
(
double
b
)
{
this
.
b
=
b
;
}
public
void
setC
(
long
c
)
{
public
void
setC
(
double
c
)
{
this
.
c
=
c
;
}
public
void
setD
(
long
d
)
{
public
void
setD
(
double
d
)
{
this
.
d
=
d
;
}
...
...
src/de/tud/kom/p2psim/impl/topology/views/fiveg/models/LinearModel.java
View file @
dac434ff
...
...
@@ -28,25 +28,25 @@ package de.tud.kom.p2psim.impl.topology.views.fiveg.models;
*/
public
class
LinearModel
extends
AbstractModel
{
private
long
a
=
1
;
private
long
b
=
0
;
private
double
a
=
1
;
private
double
b
=
0
;
public
void
setA
(
long
a
)
{
public
void
setA
(
double
a
)
{
this
.
a
=
a
;
}
public
void
setB
(
long
b
)
{
public
void
setB
(
double
b
)
{
this
.
b
=
b
;
}
@Override
public
long
getLong
(
int
users
)
{
return
this
.
a
*
users
+
this
.
b
;
return
(
long
)
(
this
.
a
*
users
+
this
.
b
)
;
}
@Override
public
double
getDouble
(
int
users
)
{
return
(
double
)
this
.
a
*
users
+
this
.
b
;
return
this
.
a
*
users
+
this
.
b
;
}
public
String
toString
()
{
...
...
src/de/tud/kom/p2psim/impl/topology/views/fiveg/models/LogarithmicModel.java
View file @
dac434ff
...
...
@@ -28,27 +28,27 @@ package de.tud.kom.p2psim.impl.topology.views.fiveg.models;
*/
public
class
LogarithmicModel
extends
AbstractModel
{
private
long
a
=
1
;
private
double
a
=
1
;
private
long
b
=
0
;
private
double
b
=
0
;
private
long
c
=
1
;
private
double
c
=
1
;
private
long
d
=
0
;
private
double
d
=
0
;
public
void
setA
(
long
a
)
{
public
void
setA
(
double
a
)
{
this
.
a
=
a
;
}
public
void
setB
(
long
b
)
{
public
void
setB
(
double
b
)
{
this
.
b
=
b
;
}
public
void
setC
(
long
c
)
{
public
void
setC
(
double
c
)
{
this
.
c
=
c
;
}
public
void
setD
(
long
d
)
{
public
void
setD
(
double
d
)
{
this
.
d
=
d
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment