Ruei-sung Lin | f0f7844 | 2012-08-13 19:04:29 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package android.bordeaux.services; |
| 17 | |
| 18 | import android.location.Location; |
| 19 | import android.text.format.Time; |
| 20 | import android.util.Log; |
| 21 | |
| 22 | import java.lang.Math; |
| 23 | import java.util.ArrayList; |
| 24 | |
| 25 | public class SemanticCluster extends BaseCluster { |
| 26 | |
| 27 | public static String TAG = "SemanticCluster"; |
| 28 | |
Ruei-sung Lin | f0f7844 | 2012-08-13 19:04:29 -0700 | [diff] [blame] | 29 | 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 Lin | 5d42ffa | 2012-08-23 16:01:57 -0700 | [diff] [blame^] | 34 | mAvgInterval = avgInterval; |
| 35 | generateSemanticId(semanticIndex); |
| 36 | } |
| 37 | |
| 38 | public SemanticCluster(String semanticId, double longitude, double latitude, |
| 39 | long avgInterval) { |
| 40 | setSemanticId(semanticId); |
Ruei-sung Lin | f0f7844 | 2012-08-13 19:04:29 -0700 | [diff] [blame] | 41 | mAvgInterval = avgInterval; |
| 42 | |
Ruei-sung Lin | 5d42ffa | 2012-08-23 16:01:57 -0700 | [diff] [blame^] | 43 | mCenter = getLocationVector(longitude, latitude); |
Ruei-sung Lin | f0f7844 | 2012-08-13 19:04:29 -0700 | [diff] [blame] | 44 | } |
| 45 | } |