Code Monkey home page Code Monkey logo

Comments (6)

gstory0404 avatar gstory0404 commented on June 16, 2024 1

文档已更新

from gtads.

gstory0404 avatar gstory0404 commented on June 16, 2024

目前看有两种,一个是优先级、一个是完全随机,是否方便支持按概率?

  • GTAdsModel.PRIORITY优先级模式 当前广告位的优先级数值越大越优先加载(当加载失败后从剩余广告中按数值大小依次重试)
  • GTAdsModel.RANDOM随机模式 当前广告位出现的概率必须大于0,如果小于0则不会加载该广告,数值越大出现的概率越高(当加载失败后从剩余广告中重新随机加载)
    @zeewell

from gtads.

zeewell avatar zeewell commented on June 16, 2024

比如,我想70%的概率显示优量汇的广告,而30的概率显示穿山甲,现在就没办法实现。

如果支持按配置概率来展示,比如,我给优量汇设置为7,而穿山甲设置为3,那么就可以了。

from gtads.

gstory0404 avatar gstory0404 commented on June 16, 2024

@zeewell 随机模式原理是 所有广告位的出现概率总和中取一个随机数,然后依次匹配是在哪个区间内,来决定加载哪个厂商广告。并非完全随机加载广告,仍受probability字段控制。
详细可以看代码 https://github.com/gstory0404/GTAds/blob/master/gtads/lib/gtads_util.dart

from gtads.

gstory0404 avatar gstory0404 commented on June 16, 2024

优量汇设置为7,穿山甲设置为3,理论上优量汇出现的概率就是无限接近70%

from gtads.

zeewell avatar zeewell commented on June 16, 2024

嗯,那可以。这样的话,实际应该理解为就是概率上的哈,不是完全随机。估计得改下文档~~

from gtads.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.