Skip to content

Commit

Permalink
Add proto definition for simulator synthetic data specification
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorilla committed May 30, 2023
1 parent 5c66d0f commit 782cc12
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ IMPORT_PREFIX = "/src/main/proto"

proto_library(
name = "test_metadata_messages_proto",
srcs = glob(["*.proto"]),
srcs = [
"test_metadata_message.proto",
"test_metadata_message_2.proto",
],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"@com_google_protobuf//:descriptor_proto",
Expand All @@ -30,3 +33,24 @@ kt_jvm_proto_library(
srcs = [":test_metadata_messages_proto"],
deps = [":test_metadata_messages_java_proto"],
)

proto_library(
name = "simulator_synthetic_data_spec_proto",
srcs = ["simulator_synthetic_data_spec.proto"],
strip_import_prefix = IMPORT_PREFIX,
deps = [
"@com_google_googleapis//google/type:date_proto",
"@com_google_protobuf//:descriptor_proto",
],
)

java_proto_library(
name = "simulator_synthetic_data_spec_java_proto",
deps = [":simulator_synthetic_data_spec_proto"],
)

kt_jvm_proto_library(
name = "simulator_synthetic_data_spec_kt_jvm_proto",
srcs = [":simulator_synthetic_data_spec_proto"],
deps = [":simulator_synthetic_data_spec_java_proto"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright 2023 The Cross-Media Measurement Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package wfa.measurement.api.v2alpha.event_group_metadata.testing;

import "google/protobuf/descriptor.proto";
import "google/type/date.proto";

option java_package = "org.wfanet.measurement.api.v2alpha.event_group_metadata.testing";
option java_multiple_files = true;

message SimulatorSyntheticDataSpec {
repeated SyntheticEventGroupSpec event_group_spec = 1;
SyntheticPopulationSpec population = 2;
}

// A sequence of VIDs represented with an inclusive beginning and end.
message VidInterval {
int64 begin = 1;
int64 end = 2;
}

// The specification of the entire VID space.
message SyntheticPopulationSpec {
VidInterval vid_interval = 1;

// For Age, Gender, Social Grade ...
// These need to be assigned at the VID level here. When generating a
// SimulatorSyntheticData you need to import the necessary EventTemplate.
repeated google.protobuf.FieldDescriptorProto population_fields = 2;

// For Device, Location, Duration ...
// These need to be assigned at the impression level in the FrequencySpec.
repeated google.protobuf.FieldDescriptorProto non_population_fields = 3;

message SubPopulation {
VidInterval vid_sub_interval = 1;

// A list of the same length as the population field descriptors whose
// values are one of each of the values for the field descriptor
// (e.g. if the first field descriptor is age bucket, then the first
// value in this list is a particular age bucket). This list should be
// unique across subpopulations.
repeated string population_fields_values = 2;
}
repeated SubPopulation sub_populations = 4;
}


// Each Synthetic event group spec indicates which VID intervals are reached.
message SyntheticEventGroupSpec {
string property_under_measurement = 1;
string description = 2;

// The VIDs reached with their frequency non-population attributes.
message FrequencySpec {
int64 frequency = 1;
// The VID intervals should be sub-intervals of SubPopulations.
message VidIntervalSpec {
VidInterval vid_intervals = 1;

// A list of the same length as the non-population field descriptors
// whose values are one of each of the values for the field
// descriptor (e.g. if the first field descriptor is device bucket,
// then the first value in this list is a particular device).
repeated string non_population_field_values = 2;
}
repeated VidIntervalSpec vid_interval_specs = 2;
}

message DateSpec {
// Date the VIDs were reached.
google.type.Date date = 1;
// Each FrequencySpec must have a unique frequency.
repeated FrequencySpec frequency_specs = 2;
}

repeated DateSpec date_specs = 3;
}

0 comments on commit 782cc12

Please sign in to comment.