source: trunk/autoquest-plugin-alignment/src/main/java/de/ugoe/cs/autoquest/plugin/alignment/seqgen/RandomSequenceGenerator.java @ 1323

Last change on this file since 1323 was 1323, checked in by rkrimmel, 10 years ago

Added Substitution Package, Fixed Array access error in SimpleSequenceGenerator?

File size: 820 bytes
Line 
1package de.ugoe.cs.autoquest.plugin.alignment.seqgen;
2import de.ugoe.cs.autoquest.eventcore.Event;
3
4import java.util.Collection;
5import java.util.List;
6
7public class RandomSequenceGenerator implements ISequenceGenerator{
8
9        private int min;
10        private int max;
11        private int count;
12       
13       
14        public RandomSequenceGenerator(int min, int max, int count) {
15                this.min = min;
16                this.max = max;
17                this.count = count;
18        }
19       
20        public int[] generate(List<Event> eventList) {
21                int[] result = new int[count];
22                for (int i=0; i<count;i++) {
23                        result[i]= min + (int)(Math.random() * ((max - min)) + 1);
24                }
25                return result;
26        }
27
28        @Override
29        public void generate(Collection<List<Event>> eventList) {
30                // TODO Auto-generated method stub
31               
32        }
33
34        @Override
35        public int[] get(int index) {
36                // TODO Auto-generated method stub
37                return null;
38        }
39}
Note: See TracBrowser for help on using the repository browser.