Commit 6708d727 authored by Lily Tsai's avatar Lily Tsai
Browse files

deal with batch size

parent 528df62c
......@@ -57,10 +57,10 @@ public class CloudAgentHelpers {
s.append(efm.getFwdingConstraint().getHopCount()).append(MESSAGEDELIMITER);
s.append(efm.getFwdingConstraint().getFanoutLimit()).append(MESSAGEDELIMITER);
s.append(efm.getFwdingConstraint().getExpirationTime()).append(MESSAGEDELIMITER);
s.append(efm.getMsgText()).append(MESSAGEDELIMITER);
s.append(efm.getEncounterConstraint().useCausalityConstraint()).append(MESSAGEDELIMITER);
s.append(efm.getEncounterConstraint().duration).append(MESSAGEDELIMITER);
s.append(efm.getEncounterConstraint().toQueryString());
s.append(efm.getEncounterConstraint().toQueryString()).append(MESSAGEDELIMITER);
s.append(efm.getMsgText());
Log.d(TAG, "Issuing efc: " + s.toString());
return SDDR_Native.c_sendToClient(s.toString());
}
......
......@@ -95,12 +95,9 @@ public class MEncounterEntry extends AbstractMemoryObject implements Serializabl
public String valsToString() {
final StringBuilder sb = new StringBuilder();
//sb.append(userHandle).append(COMPONENTDELIMITER);
//sb.append(String.valueOf(encounterPKID)).append(COMPONENTDELIMITER);
sb.append(String.valueOf(startTime)).append(COMPONENTDELIMITER);
sb.append(String.valueOf(endTime)).append(COMPONENTDELIMITER);
sb.append(secret.toString()).append(COMPONENTDELIMITER);
//sb.append(encounterID.toString()).append(COMPONENTDELIMITER);
sb.append(myTopicHandle);
return sb.toString();
}}
......@@ -36,7 +36,6 @@ public class MLocation extends AbstractMemoryObject implements Serializable {
public String valsToString() {
final StringBuilder sb = new StringBuilder();
//sb.append(Preferences.getInstance().getUserHandle()).append(COMPONENTDELIMITER);
sb.append(String.valueOf(latitude)).append(COMPONENTDELIMITER);
sb.append(String.valueOf(longitude)).append(COMPONENTDELIMITER);
sb.append(String.valueOf(timestamp));
......
......@@ -30,8 +30,8 @@ import com.google.api.services.calendar.model.Event;
import com.google.api.services.calendar.model.Events;
import org.mpisws.ebcmessageapp.R;
import org.mpisws.messaging.forwarding.EncounterQueryConstraint;
import org.mpisws.messaging.forwarding.SpaceTimeIntersectConstraint;
import org.mpisws.messaging.constraints.EncounterQueryConstraint;
import org.mpisws.messaging.constraints.SpaceTimeIntersectConstraint;
import java.io.IOException;
import java.time.LocalDateTime;
......
......@@ -20,7 +20,7 @@ import java.util.List;
public class Utils {
private static final String TAG = getTAG(Utils.class);
public static final int BATCH_SIZE = 32;
public static final int BATCH_SIZE = 1;
public static String getTAG(final Class c) {
return "EbN-Java-" + c.getSimpleName();
......@@ -50,7 +50,7 @@ public class Utils {
int i = 0;
List<List<T>> batches = new ArrayList<>();
while(i<collection.size()){
int nextInc = Math.min(collection.size()-i,32);
int nextInc = Math.min(collection.size()-i,BATCH_SIZE);
List<T> batch = collection.subList(i,i+nextInc);
batches.add(batch);
i = i + nextInc;
......
......@@ -17,8 +17,6 @@ public class TestConstraintQuery {
static long starttime = 10000;
static long overlapduration = 10000;
static long encountercausaltime = 19210;
static List<TrajectoryConstraint.TrajectoryElement> trajectoryIntersect = new ArrayList<>();
static List<TrajectoryConstraint.TrajectoryElement> trajectoryProject = new ArrayList<>();
public static void main(String[] args) {
for (EncounterQueryConstraint constraint : getConstraints()) {
......@@ -28,14 +26,10 @@ public class TestConstraintQuery {
public static List<EncounterQueryConstraint> getConstraints (){
for (int i = 0; i < 3; i++) {
trajectoryIntersect.add(new TrajectoryConstraint.TrajectoryElement(spaceRegion, starttime*i));
trajectoryProject.add(new TrajectoryConstraint.TrajectoryElement(spaceRegion));
}
List<EncounterQueryConstraint> constraints = new ArrayList<>();
constraints.add(new SpaceTimeIntersectConstraint(starttime, starttime+1000, overlapduration, spaceRegion, encountercausaltime));
constraints.add(new TrajectoryConstraint(trajectoryIntersect, overlapduration, encountercausaltime));
constraints.add(new TrajectoryConstraint(trajectoryProject, overlapduration, encountercausaltime));
constraints.add(new AllEncountersConstraint());
return constraints;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment