Skip to content

Commit

Permalink
Alexei's update
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed Apr 23, 2018
1 parent 816684a commit 1242264
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/bdsky/MultiSkyline.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import beast.core.CalculationNode;
import beast.core.Input;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;

/**
* A multiskyline made up of simple skylines.
Expand All @@ -17,10 +14,14 @@ public class MultiSkyline extends CalculationNode implements Skyline {
public Input<List<SimpleSkyline>> skylineInput = new Input<>("skyline", "the simple skylines making up this multiple skyline", new ArrayList<>());

public MultiSkyline(SimpleSkyline... skyline) {
try {
initByName("skyline", Arrays.asList(skyline));
} catch (Exception e) {
throw new RuntimeException(e);
if (skyline.length > 0) {
try {
initByName("skyline", Arrays.asList(skyline));
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
throw new IllegalArgumentException("The multiple skyline cannot be the empty list of simple skylines !");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/bdsky/MultiSkylineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void testGetValue() throws Exception {

MultiSkyline multiSkyline = new MultiSkyline(simpleSkylines.toArray(new SimpleSkyline[0]));
// multiSkyline.skylineInput.setValue(simpleSkylines,multiSkyline);
multiSkyline.initAndValidate();
// multiSkyline.initAndValidate();

assertEquals(2, multiSkyline.getDimension());

Expand Down

0 comments on commit 1242264

Please sign in to comment.