Regarding your TeaMachineSUL.java: Why would you want to extend ExampleCoffeeMachine? Normally you inherit from other classes if you want to reuse some functionality. In your case, you have a new input alphabet and a new SUL, so nothing to reuse from the original coffee machine (+ you only define static methods, that can't override other static methods).
Regarding your TeaMachineSUL1.java: It worked fine when I imported it in IntelliJ. It may be a problem with Eclipse, which uses its own compiler that sometimes has problems with heavy use of generics. Other than that, you extend DefaultMealyLearningExample from the de.learnlib.testsupport group, which (as the name suggest) is primarily used for testing -- so you need to work your way around to use it as a normal class (set the maven depedency scope to <scope>compile</scope>).
Overall, I suggest you just simply write a standalone TeaMachineSUL class which provides the information you need (alphabet, SUL) without inheriting from any special class.
> --
> You received this message because you are subscribed to the Google Groups "LearnLib Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
learnlib-qa...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
> package com.baz.LearningMealyMachine;
>
> import de.learnlib.examples.mealy.ExampleCoffeeMachine;
> import net.automatalib.automata.transout.MutableMealyMachine;
> import net.automatalib.automata.transout.impl.compact.CompactMealy;
> import net.automatalib.util.automata.builders.AutomatonBuilders;
> import net.automatalib.words.Alphabet;
> import net.automatalib.words.impl.Alphabets;
>
> public class TeaMachineSUL extends ExampleCoffeeMachine{
>
> public static enum Input {
> COIN,
> BUTTON
> }
>
> public final static String out_ok = "OK";
> public final static String out_nok = "NOK";
> public final static String out_tea = "Tea!";
>
> public static Alphabet<Input> createInput() {
> return Alphabets.fromEnum(Input.class);
> }
>
> public static <S,T,A extends MutableMealyMachine<S,? super Input,T,? super String>>
> A construcTeaMachineSUL(A machine) {
>
> machine = AutomatonBuilders.forMealy(machine).withInitial("0").from("0").on(Input.BUTTON)
> .withOutput(out_nok).loop().from("0").on(Input.COIN).withOutput(out_ok).to("1")
> .from("1").on(Input.COIN).withOutput(out_nok).loop().from("1").on(Input.BUTTON).withOutput(out_tea)
> .to("0").create();
>
> return machine;
> }
>
> public static CompactMealy<Input,String> construcTeaMachineSUL() {
> return construcTeaMachineSUL(new CompactMealy<Input,String>(createInput()));
> }
>
>
> // public static TeaMachineSUL createExample() {
> // return new TeaMachineSUL();
> // }
>
>
>
> }
>
>
> package com.baz.LearningMealyMachine;
>
> import de.learnlib.examples.DefaultLearningExample.DefaultMealyLearningExample;
> import de.learnlib.examples.mealy.ExampleCoffeeMachine;
> import de.learnlib.examples.mealy.ExampleCoffeeMachine.Input;
> import net.automatalib.automata.transout.MutableMealyMachine;
> import net.automatalib.automata.transout.impl.compact.CompactMealy;
> import net.automatalib.util.automata.builders.AutomatonBuilders;
> import net.automatalib.words.Alphabet;
> import net.automatalib.words.impl.Alphabets;
>
> public class TeaMachineSUL1 extends DefaultMealyLearningExample<Input,String> {
>
>
> public static enum Input {
> COIN,
> BUTTON
> }
>
> public final static String out_ok = "OK";
> public final static String out_nok = "NOK";
> public final static String out_tea = "Tea!";
>
>
> public static Alphabet<Input> createInputAlphabet() {
> return Alphabets.fromEnum(Input.class);
> }
>
>
> /**
> * Construct and return a machine representation of this example
> *
> * @return a Mealy machine representing the Tea machine example
> */
> public static <S,T,A extends MutableMealyMachine<S,? super Input,T,? super String>>
> A constructMachine(A machine) {
>
> machine = AutomatonBuilders.forMealy(machine).withInitial("0").from("0").on(Input.BUTTON)
> .withOutput(out_nok).loop().from("0").on(Input.COIN).withOutput(out_ok).to("1")
> .from("1").on(Input.COIN).withOutput(out_nok).loop().from("1").on(Input.BUTTON).withOutput(out_tea)
> .to("0").create();
>
>
> return machine;
>
> }
>
> public static CompactMealy<Input,String> constructMachine() {
> return constructMachine(new CompactMealy<Input,String>(createInputAlphabet()));
> }
>
> public static TeaMachineSUL1 createExample() {
> return new TeaMachineSUL1();
> }
>
>
> public TeaMachineSUL1() {
> super(constructMachine());
> }
>
> }