Question regarding subscribed population

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Question regarding subscribed population

serkan
Hi all,

For several days, I am trying to figure out a problem about customer counts. I am tracking the number of my consumers and producers via tariff transaction messages. However, there is a clear difference between my results and visualizer. For instance, I count my producers as 60, but visualizer says 16.

Do you know an accurate and simple way of getting subscribed population based on power type?

Regards.
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding subscribed population

grampajohn
Administrator
serkan wrote
There is a clear difference between my customer-count results and visualizer. For instance, I count my producers as 60, but visualizer says 16.

Do you know an accurate and simple way of getting subscribed population based on power type?
The numbers in the tariff transactions should be correct. I don't know how the visualizer determines these numbers - perhaps Jurica could address this question?

Hope this helps -

John
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding subscribed population

jurica.babic
In reply to this post by serkan
Hi!

Can you tell us what page are you using in Visualizer for viewing customer counts?

On "Tariff market -> Cumulative" scores you can see customer counts for each of brokers.

Similary, "Tariff market -> Per timeslot scores" you can see per timeslot changes (deltas) in customer counts for each of brokers.

Does this help?

Cheers,
Jurica

Reply | Threaded
Open this post in threaded view
|

Re: Question regarding subscribed population

serkan
Dear John and Jurica.

First of all, thank you for your interests. I think there is no problem with visualizer. Probably I am doing something wrong. Let's proceed with the following code.

At the begining of the game, total 50k consumer and 92 producers are declared by the server. And I can see these numbers on the visualizer. However my counter sometimes shows me 150 subscribed producer! Situation is same for the count of consumers. Isn't it weird? Am I missing something here?

public void viewUserCount()
  {
          int consumer = 0;
          int producer = 0;
          for (TariffSpecification spec : customerSubscriptions.keySet()) {
              HashMap<CustomerInfo, CustomerRecord> customerMap = customerSubscriptions.get(spec);
              for (CustomerRecord record : customerMap.values()) {
             if(spec.isValid())
             {
                        if(spec.getPowerType().isConsumption())
                        consumer += record.subscribedPopulation;
                        if(spec.getPowerType().isProduction())
                        producer += record.subscribedPopulation;
             }
              }
              }
        System.out.println("My producers: "+producer+", my consumers: "+consumer);
  }
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding subscribed population

serkan
I fixed the problem and wanted to let you know.

The code above counts the population of my all tariffs, including revoked ones. Thats why I see more counts.