-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for non-periodic events & property-based jdeeco setup in the sim
- Loading branch information
Showing
13 changed files
with
370 additions
and
59 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
jdeeco-core/src/cz/cuni/mff/d3s/deeco/DeecoProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package cz.cuni.mff.d3s.deeco; | ||
|
||
public final class DeecoProperties { | ||
public static final String PACKET_SIZE = "deeco.publish.packetsize"; | ||
public static final String PUBLISHING_PERIOD = "deeco.publish.period"; | ||
public static final String USE_INDIVIDUAL_KNOWLEDGE_PUBLISHING = "deeco.publish.individual"; | ||
public static final String DISABLE_BOUNDARY_CONDITIONS = "deeco.boundary.disable"; | ||
public static final String DISABLE_GOSSIP_CONDITION = "deeco.gossipcnd.disable"; | ||
public static final String GOSSIP_CONDITION_RSSI = "deeco.gossipcnd.rssi"; | ||
public static final String MESSAGE_CACHE_DEADLINE = "deeco.receive.cache.deadline"; | ||
public static final String MESSAGE_CACHE_WIPE_PERIOD = "deeco.receive.cache.period"; | ||
|
||
} |
78 changes: 78 additions & 0 deletions
78
jdeeco-core/src/cz/cuni/mff/d3s/deeco/model/runtime/api/TimeTrigger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
*/ | ||
package cz.cuni.mff.d3s.deeco.model.runtime.api; | ||
|
||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* A representation of the model object '<em><b>Time Trigger</b></em>'. | ||
* <!-- end-user-doc --> | ||
* | ||
* <p> | ||
* The following features are supported: | ||
* <ul> | ||
* <li>{@link cz.cuni.mff.d3s.deeco.model.runtime.api.TimeTrigger#getPeriod <em>Period</em>}</li> | ||
* <li>{@link cz.cuni.mff.d3s.deeco.model.runtime.api.TimeTrigger#getOffset <em>Offset</em>}</li> | ||
* </ul> | ||
* </p> | ||
* | ||
* @see cz.cuni.mff.d3s.deeco.model.runtime.meta.RuntimeMetadataPackage#getTimeTrigger() | ||
* @model | ||
* @generated | ||
*/ | ||
public interface TimeTrigger extends Trigger { | ||
/** | ||
* Returns the value of the '<em><b>Period</b></em>' attribute. | ||
* The default value is <code>"0"</code>. | ||
* <!-- begin-user-doc --> | ||
* <p> | ||
* If the meaning of the '<em>Period</em>' attribute isn't clear, | ||
* there really should be more of a description here... | ||
* </p> | ||
* <!-- end-user-doc --> | ||
* @return the value of the '<em>Period</em>' attribute. | ||
* @see #setPeriod(long) | ||
* @see cz.cuni.mff.d3s.deeco.model.runtime.meta.RuntimeMetadataPackage#getTimeTrigger_Period() | ||
* @model default="0" required="true" | ||
* @generated | ||
*/ | ||
long getPeriod(); | ||
|
||
/** | ||
* Sets the value of the '{@link cz.cuni.mff.d3s.deeco.model.runtime.api.TimeTrigger#getPeriod <em>Period</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @param value the new value of the '<em>Period</em>' attribute. | ||
* @see #getPeriod() | ||
* @generated | ||
*/ | ||
void setPeriod(long value); | ||
|
||
/** | ||
* Returns the value of the '<em><b>Offset</b></em>' attribute. | ||
* The default value is <code>"0"</code>. | ||
* <!-- begin-user-doc --> | ||
* <p> | ||
* If the meaning of the '<em>Offset</em>' attribute isn't clear, | ||
* there really should be more of a description here... | ||
* </p> | ||
* <!-- end-user-doc --> | ||
* @return the value of the '<em>Offset</em>' attribute. | ||
* @see #setOffset(long) | ||
* @see cz.cuni.mff.d3s.deeco.model.runtime.meta.RuntimeMetadataPackage#getTimeTrigger_Offset() | ||
* @model default="0" required="true" | ||
* @generated | ||
*/ | ||
long getOffset(); | ||
|
||
/** | ||
* Sets the value of the '{@link cz.cuni.mff.d3s.deeco.model.runtime.api.TimeTrigger#getOffset <em>Offset</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @param value the new value of the '<em>Offset</em>' attribute. | ||
* @see #getOffset() | ||
* @generated | ||
*/ | ||
void setOffset(long value); | ||
|
||
} // TimeTrigger |
217 changes: 217 additions & 0 deletions
217
jdeeco-core/src/cz/cuni/mff/d3s/deeco/model/runtime/impl/TimeTriggerImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
/** | ||
*/ | ||
package cz.cuni.mff.d3s.deeco.model.runtime.impl; | ||
|
||
import cz.cuni.mff.d3s.deeco.model.runtime.api.TimeTrigger; | ||
|
||
import cz.cuni.mff.d3s.deeco.model.runtime.meta.RuntimeMetadataPackage; | ||
|
||
import org.eclipse.emf.common.notify.Notification; | ||
|
||
import org.eclipse.emf.ecore.EClass; | ||
|
||
import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* An implementation of the model object '<em><b>Time Trigger</b></em>'. | ||
* <!-- end-user-doc --> | ||
* <p> | ||
* The following features are implemented: | ||
* <ul> | ||
* <li>{@link cz.cuni.mff.d3s.deeco.model.runtime.impl.TimeTriggerImpl#getPeriod <em>Period</em>}</li> | ||
* <li>{@link cz.cuni.mff.d3s.deeco.model.runtime.impl.TimeTriggerImpl#getOffset <em>Offset</em>}</li> | ||
* </ul> | ||
* </p> | ||
* | ||
* @generated | ||
*/ | ||
public class TimeTriggerImpl extends TriggerImpl implements TimeTrigger { | ||
/** | ||
* The default value of the '{@link #getPeriod() <em>Period</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getPeriod() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected static final long PERIOD_EDEFAULT = 0L; | ||
|
||
/** | ||
* The cached value of the '{@link #getPeriod() <em>Period</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getPeriod() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected long period = PERIOD_EDEFAULT; | ||
|
||
/** | ||
* The default value of the '{@link #getOffset() <em>Offset</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getOffset() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected static final long OFFSET_EDEFAULT = 0L; | ||
|
||
/** | ||
* The cached value of the '{@link #getOffset() <em>Offset</em>}' attribute. | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @see #getOffset() | ||
* @generated | ||
* @ordered | ||
*/ | ||
protected long offset = OFFSET_EDEFAULT; | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
protected TimeTriggerImpl() { | ||
super(); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
protected EClass eStaticClass() { | ||
return RuntimeMetadataPackage.Literals.TIME_TRIGGER; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public long getPeriod() { | ||
return period; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public void setPeriod(long newPeriod) { | ||
long oldPeriod = period; | ||
period = newPeriod; | ||
if (eNotificationRequired()) | ||
eNotify(new ENotificationImpl(this, Notification.SET, RuntimeMetadataPackage.TIME_TRIGGER__PERIOD, oldPeriod, period)); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public long getOffset() { | ||
return offset; | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
public void setOffset(long newOffset) { | ||
long oldOffset = offset; | ||
offset = newOffset; | ||
if (eNotificationRequired()) | ||
eNotify(new ENotificationImpl(this, Notification.SET, RuntimeMetadataPackage.TIME_TRIGGER__OFFSET, oldOffset, offset)); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
switch (featureID) { | ||
case RuntimeMetadataPackage.TIME_TRIGGER__PERIOD: | ||
return getPeriod(); | ||
case RuntimeMetadataPackage.TIME_TRIGGER__OFFSET: | ||
return getOffset(); | ||
} | ||
return super.eGet(featureID, resolve, coreType); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public void eSet(int featureID, Object newValue) { | ||
switch (featureID) { | ||
case RuntimeMetadataPackage.TIME_TRIGGER__PERIOD: | ||
setPeriod((Long)newValue); | ||
return; | ||
case RuntimeMetadataPackage.TIME_TRIGGER__OFFSET: | ||
setOffset((Long)newValue); | ||
return; | ||
} | ||
super.eSet(featureID, newValue); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public void eUnset(int featureID) { | ||
switch (featureID) { | ||
case RuntimeMetadataPackage.TIME_TRIGGER__PERIOD: | ||
setPeriod(PERIOD_EDEFAULT); | ||
return; | ||
case RuntimeMetadataPackage.TIME_TRIGGER__OFFSET: | ||
setOffset(OFFSET_EDEFAULT); | ||
return; | ||
} | ||
super.eUnset(featureID); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public boolean eIsSet(int featureID) { | ||
switch (featureID) { | ||
case RuntimeMetadataPackage.TIME_TRIGGER__PERIOD: | ||
return period != PERIOD_EDEFAULT; | ||
case RuntimeMetadataPackage.TIME_TRIGGER__OFFSET: | ||
return offset != OFFSET_EDEFAULT; | ||
} | ||
return super.eIsSet(featureID); | ||
} | ||
|
||
/** | ||
* <!-- begin-user-doc --> | ||
* <!-- end-user-doc --> | ||
* @generated | ||
*/ | ||
@Override | ||
public String toString() { | ||
if (eIsProxy()) return super.toString(); | ||
|
||
StringBuffer result = new StringBuffer(super.toString()); | ||
result.append(" (period: "); | ||
result.append(period); | ||
result.append(", offset: "); | ||
result.append(offset); | ||
result.append(')'); | ||
return result.toString(); | ||
} | ||
|
||
} //TimeTriggerImpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.