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

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

pre-catastraphic-changes-commit

File size: 891 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 SequenceGenerator{
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 NumberSequence get(int index) {
36                // TODO Auto-generated method stub
37                return null;
38        }
39
40        @Override
41        public int sequenceCount() {
42                return count;
43        }
44       
45}
Note: See TracBrowser for help on using the repository browser.