Skip to content

Commit

Permalink
switched to Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rsfzi committed Dec 4, 2024
1 parent 6fa4c83 commit 03dff4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -162,7 +163,7 @@ public Double probability(List<InputValue<I>> inputs) {
}

@Override
public void init(ISeedProvider seedProvider) {
public void init(Optional<ISeedProvider> seedProvider) {
if (initialized) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -214,7 +215,7 @@ public Double probability(Trajectory<I> value) {
}

@Override
public void init(ISeedProvider seedProvider) {
public void init(Optional<ISeedProvider> seedProvider) {
if (initialized) {
throw new RuntimeException("already initialized");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.palladiosimulator.envdyn.api.tests.bn;

import java.util.Optional;

import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.junit.BeforeClass;
Expand All @@ -15,7 +17,6 @@
import tools.mdsd.probdist.api.factory.ProbabilityDistributionFactory;
import tools.mdsd.probdist.api.parser.DefaultParameterParser;
import tools.mdsd.probdist.api.parser.ParameterParser;
import tools.mdsd.probdist.api.random.NoSeedProvider;
import tools.mdsd.probdist.distributiontype.ProbabilityDistributionRepository;

public class BayesianModelTest {
Expand All @@ -41,7 +42,7 @@ public static void setUpModels() {
IProbabilityDistributionRepositoryLookup probDistRepoLookup = new ProbabilityDistributionRepositoryLookup(
distTypes);

defaultProbabilityDistributionFactory = new ProbabilityDistributionFactory(new NoSeedProvider());
defaultProbabilityDistributionFactory = new ProbabilityDistributionFactory(Optional.empty());
IProbabilityDistributionRegistry<CategoricalValue> probabilityDistributionRegistry = defaultProbabilityDistributionFactory;
ParameterParser parameterParser = new DefaultParameterParser();
probabilityDistributionRegistry
Expand Down

0 comments on commit 03dff4c

Please sign in to comment.