blob: 222111d3a4b7d76a23f20d825de64c010eca7678 [file] [log] [blame]
Ruei-sung Linf0f78442012-08-13 19:04:29 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package android.bordeaux.services;
17
18import android.location.Location;
19import android.text.format.Time;
20import android.util.Log;
21
22import java.lang.Math;
23import java.util.ArrayList;
24
25public class SemanticCluster extends BaseCluster {
26
27 public static String TAG = "SemanticCluster";
28
Ruei-sung Linf0f78442012-08-13 19:04:29 -070029 public SemanticCluster(LocationCluster cluster, long avgInterval, long semanticIndex) {
30 mCenter = new double[3];
31 for (int i = 0; i < 3; ++i) {
32 mCenter[i] = cluster.mCenter[i];
33 }
Ruei-sung Lin5d42ffa2012-08-23 16:01:57 -070034 mAvgInterval = avgInterval;
35 generateSemanticId(semanticIndex);
36 }
37
38 public SemanticCluster(String semanticId, double longitude, double latitude,
39 long avgInterval) {
40 setSemanticId(semanticId);
Ruei-sung Linf0f78442012-08-13 19:04:29 -070041 mAvgInterval = avgInterval;
42
Ruei-sung Lin5d42ffa2012-08-23 16:01:57 -070043 mCenter = getLocationVector(longitude, latitude);
Ruei-sung Linf0f78442012-08-13 19:04:29 -070044 }
45}