public class Actor extends Vertex<Actor> implements Activatable
social network
.
In usual diffusion models for the spread of an idea or innovation through a
social network,
each individual actor is either active (an adopter of the innovation) or inactive.
An inactive actor is activated if the influence of its incident neighbors,
each given by corresponding weighted edges, in sum outvalue its threshold.
For details see
D. Kempe, J. Kleinberg & É. Tardos:
‘Maximizing the Spread of Influence through a Social Network’,
Proc. 9th ACM SIGKDD Intl. Conf. on Knowledge Discovery and Data Mining.
2003.
Modifier and Type | Field and Description |
---|---|
protected boolean |
active
Flag whether this actor is active.
|
protected double |
threshold
The threshold of this actor.
|
Constructor and Description |
---|
Actor(int index)
Creates an actor with the specified index which also specifies its name.
|
Actor(int index,
double threshold)
Creates an actor with the specified index and threshold, where the index
also specifies its name.
|
Actor(int index,
String name)
Creates an actor with the specified index and name.
|
Actor(int index,
String name,
Actor[] adjacency)
Creates an actor with the specified name, index, and adjacency list.
|
Actor(int index,
String name,
Actor[] adjacency,
double threshold)
Creates an actor with the specified name, index, adjacency list, and threshold.
|
Actor(int index,
String name,
double threshold)
Creates an actor with the specified name, index, adjacency list, and threshold.
|
Modifier and Type | Method and Description |
---|---|
Actor |
copy()
Creates and returns a copy of this actor.
|
double |
getThreshold()
Returns the threshold of this actor.
|
boolean |
isActive()
Returns whether this actor is active.
|
void |
setActive(boolean active)
Sets the flag whether this actor is active.
|
void |
setThreshold(double threshold)
Sets the threshold of this actor.
|
String |
toString() |
getAdjacency, getDistance, getIndex, getName, getPredecessor, isInProcess, isMarked, mark, setAdjacency, setDistance, setIndex, setInProcess, setMarked, setName, setPredecessor
protected boolean active
protected double threshold
public Actor(int index)
false
and 0.0, respectively.index
- the index of this actor in a social network. The index must be
unique in a given network, and all indices should in total occupy the
range {0, 1, ..., n–1} where n denotes the number of actors
in the network.public Actor(int index, double threshold)
false
.index
- the index of this actor in a social network. The index must be
unique in a given network, and all indices should in total occupy the
range {0, 1, ..., n–1} where n denotes the number of actors
in the network.threshold
- the threshold of this actorpublic Actor(int index, String name)
false
and 0.0, respectively.index
- the index of this actor in a social network. The index must be
unique in a given network, and all indices should in total occupy the
range {0, 1, ..., n–1} where n denotes the number of actors
in the network.name
- the name of this actorpublic Actor(int index, String name, double threshold)
false
.index
- the index of this actorname
- the name of this actorthreshold
- the threshold of this actorpublic Actor(int index, String name, Actor[] adjacency)
false
and 0.0, respectively.index
- the index of this actorname
- the name of this actoradjacency
- the adjacency of this actorpublic Actor(int index, String name, Actor[] adjacency, double threshold)
false
.index
- the index of this actorname
- the name of this actoradjacency
- the adjacency of this actorthreshold
- the threshold of this actorpublic Actor copy()
x.copy() != x
is true,.public boolean isActive()
isActive
in interface Activatable
public void setActive(boolean active)
setActive
in interface Activatable
active
- flag whether this actor is activepublic double getThreshold()
getThreshold
in interface Activatable
public void setThreshold(double threshold)
setThreshold
in interface Activatable
threshold
- the threshold of this actor