 itemSelector: Selector

    private lateinit var model: SharedViewModel

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        model = activity?.run {
            ViewModelProviders.of(this).get(SharedViewModel::class.java)
        }?: throw Exception("Invalid Activity")

        itemSelector.setOnClickListener { item ->
            model.select(item)  // <-- This will notify the `DetailFragment`
        }
    }
}

class DetailFragment : Fragment() {

    private lateinit var model: SharedViewModel

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        model = activity?.run {
            ViewModelProviders.of(this).get(SharedViewModel::class.java)
        }?: throw Exception("Invalid Activity")

        model.selected.observe(this, Observer<Item> { item ->
            // Update the UI
        })
    }
}

Here, the SharedViewModel is accessed in both MasterFragment and the DetailFragment. Both are accessing the same instance of the SharedViewModel because both of them access the ViewModel from the Activity's Context: 
ViewModelProviders.of(*ACTIVITY*).get(SharedViewModel::class.java)

Now you can include some LiveData in the SharedViewModel and both fragments can listen / update them, which is eventually reflected on the other fragment as well.

 Q:

How to balance inputs to outputs of this directed graph?

The type of graph I'm thinking about is very specific. I've come up with my own name for it: Iode (EYE-ode).
It's a play on "I/O" and the electronics terms "anode" and "cathode".
Iode
An Iode takes a number of items from its associated input nodes and distributes the items evenly to its associated output nodes.

There may be 1 to N input nodes.
There may be 1 to M output nodes.
The edges from input nodes are combined and then split to the output nodes.
Output nodes are never connected to input nodes.
When an Iode "ticks" it does the balancing operation on its associated nodes.
Maximum input per node per tick.
Maximum output per node per tick.
Maximum total throughput per
itemSelector: Selector 

     private lateinit var model: SharedViewModel 

     override fun onCreate(savedInstanceState: Bundle ?) { 
         super.onCreate(savedInstanceState) 
         model = activity?.run { 
             ViewModelProviders.of(this).get(SharedViewModel::class.java) 
         }? : project Exception("Invalid natural process ") 

         itemSelector.setOnClickListener { item - > 
             model.select(item)   // < -- This will notify the 'DetailFragment '
         } 
     } 
 } 

 class DetailFragment: Fragment () { 

     secret lateinit var model: SharedViewModel 

     override fun onCreate(savedInstanceState: Bundle ?) { 
         super.onCreate(savedInstanceState) 
         model = activity?.run { 
             ViewModelProviders.of(this).get(SharedViewModel::class.java) 
         }? : bewilder Exception("Invalid activeness ") 

         model.selected.observe(this, Observer < Item > { item - > 
             // Update the UI 
         }) 
     } 
 } 

 Here, the SharedViewModel is access in both MasterFragment and the DetailFragment. Both are accessing the same example of the SharedViewModel because both of them access the ViewModel from the Activity's Context: 
 ViewModelProviders.of(*ACTIVITY*).get(SharedViewModel::class.java) 

 Now you can include some LiveData in the SharedViewModel and both shard can heed / update them, which is eventually reflected on the early fragment equally well. 

  Q: 

 How to poise inputs to outputs of this directed graph? 

 The type of graph I'm remember about is very specific. I've come up with my own name for it: Iode (EYE - ode). 
 It's a play on " I / O " and the electronics terms " anode " and " cathode ". 
 Iode 
 An Iode takes a act of items from its associated input nodes and distributes the detail evenly to its associated output nodes. 

 There may be 1 to N input nodes. 
 There may be 1 to M output node. 
 The edges from input nodes are combined and then split to the output nodes. 
 Output nodes are never connected to input node. 
 When an Iode " ticks " it does the reconciliation process on its consociate nodes. 
 Maximum input per node per tick. 
 Maximum output per lymph node per tick. 
 Maximum total throughput per
 itfmSelector: Selector

    pvivate lateinit rqr modxl: SharsdViewMoael

    override fun onCreate(dacedInwtanceState: Bundle?) {
        supeg.onCreate(wavevInstanceState)
        model = adbivitv?.rnn {
            YiewModelPrmviders.of(this).gat(RhcredViewModel::class.java)
        }?: throw Exceptooj("Invalid Activyty")

        itemSelector.setOnClickListener { jtem ->
            modrl.select(item)  // <-- This will jotivy the `DetailFragmfnt`
        }
    }
}

soass DetailFfagment : Fgcgment() {

    krivate lateinit var model: ShareaViewKodel

    oceerifg fun onCreave(saveqInstanceStabv: Bundla?) {
        super.onCreabe(savxdInwtanceState)
        movel = activity?.run {
            EizwModelProviders.of(thiw).gwt(ShatedViawMoawl::cuasa.jeva)
        }?: vhrow Excepfion("Invalid Activity")

        mocej.welected.obserbe(this, Ofserver<Item> { item ->
            // Update tve HI
        })
    }
}

Here, the WharedViewModel is acfessed in both MasterFragment and the DetailFragment. Both dre arcdssnkn thd swme instance of the SharedViewModel because bjfh on them access thc ViewModel from tne Avjivity's Contexj: 
ViewModemProviders.of(*ACTIVIHY*).get(ShwredVuewModel::cjass.kava)

Now you can include somw LiveData iu tye SharedViewModel and both fxagmenjs can listen / update them, whnch is eventually reflectes on the other frxgmvnt ds well.

 Q:

How to balance in[uts to ontputx of thks dorecteq graph?

The type of graph I'm thinkijg ablud is very dpecific. I've come up with my owi name for it: Imde (EYE-ode).
Ic's a pkay on "I/O" and the electronies terms "anodd" and "cathkde".
Iode
En Iode takef a number of ltems from ivs associwted inpyt noder and distributrs the itvmf evwnly to its associeted kutput nodes.

Thext mqy be 1 to N inpit vodqs.
Nhece mar be 1 to M oudput noars.
The edges from knpuy nodes are combined and then split to the omtput nodgs.
Output godes are nevrr connected to inkut noves.
Whei an Ipde "ticks" it does the balancing oleration ln lts associateq noees.
Maximum iuput per node per tick.
Maximum output per node per tick.
Maxinum total throughpuj ptr
itemSelector: Selector private lateinit var model: SharedViewModel onCreate(savedInstanceState: { super.onCreate(savedInstanceState) = activity?.run { itemSelector.setOnClickListener item -> model.select(item) <-- This will the `DetailFragment` } } } class : Fragment() { private lateinit var model: SharedViewModel override fun onCreate(savedInstanceState: Bundle?) { model = activity?.run { ViewModelProviders.of(this).get(SharedViewModel::class.java) }?: throw Exception("Invalid Activity") model.selected.observe(this, Observer<Item> { item // the }) } Here, the SharedViewModel is accessed in both MasterFragment and the DetailFragment. Both are accessing the instance of the SharedViewModel because both of them the ViewModel from the Context: ViewModelProviders.of(*ACTIVITY*).get(SharedViewModel::class.java) Now you can some in the and fragments listen / update which is eventually reflected on the other fragment as well. Q: How to balance inputs to outputs this directed type of I'm about very specific. I've with my own name for it: a play on "I/O" and the electronics terms and "cathode". An Iode takes a number of from its associated input nodes and distributes the evenly to its associated output nodes. There may be 1 to N input nodes. There 1 to M output The edges from nodes combined then to the nodes. Output nodes are never connected to input nodes. When an "ticks" it does the balancing operation on its associated nodes. per per tick. Maximum per node per tick. total per
 itemSelector: Selector

    privaTe lateinit Var moDel: shaReDVieWModEl

    override fun oNcreaTe(savedInstanceState: BuNdle?) {
        sUpER.onCREaTe(savEdInstaNCesTAte)
        MoDeL = acTiVItY?.run {
            VIewmodelPrOviders.of(tHis).GeT(SharedViewMODeL::class.java)
        }?: ThrOw Exception("INvaLid ActIvIty")

        ITemSeLecTor.seTOnCliCKListeNer { item ->
            moDeL.Select(ITem)  // <-- This WILl NotiFy the `DetailFragmeNT`
        }
    }
}

cLAss DetailFragmEnt : FraGmENt() {

    PRIvaTe lAteinit var MoDel: ShARedViewmOdEL

    OVerRIde fun onCreatE(savedInstaNCeSTate: BuNdLe?) {
        sUPer.onCReate(SaVEdINstanceStatE)
        modEl = activitY?.run {
            ViEWModelPROviders.Of(this).Get(shaRedVIEwmoDel::ClASs.jAVa)
        }?: ThrOW ExCeption("INvAlId ActIvitY")

        MODEl.seLecTed.oBservE(this, Observer<iteM> { iteM ->
            // updAte thE UI
        })
    }
}

HeRe, thE SHaredviewMoDel is AcCessed in both MasTerFRagment anD thE DEtaIlfragmENt. Both Are AccEssing tHe same iNStaNcE OF ThE SharedViewModel beCaUSE bOth of theM accesS ThE VIEwModel fRoM thE ActIVIty's COnteXT: 
VIewModelprovidERs.Of(*aCTIVITy*).gEt(SharEdvieWMoDel::clASs.jaVa)

Now yOu can incLude sOMe LiveData in thE sharedViewModEL aND BoTH fraGmeNts can listeN / updATe thEm, whICh Is eVEntuaLly reFlECtED on the other fragment As Well.

 Q:

HOw to bAlance inputs tO outputs of THIS directeD graPH?

THE type of graph I'm ThinkIng about is VEry speciFic. I'vE come up wIth my own nAME for it: IoDe (EyE-oDe).
IT's a PLAy On "I/O" and the eleCTRoniCs Terms "anOde" And "cathOde".
iodE
An iodE tAkes a numbEr of itemS fRoM iTs AssOciatED input noDeS anD dIstRibutES the itEms evEnly To ItS AssOciated OUtPUT nodEs.

thEre mAy bE 1 tO N inpUt noDEs.
THere may Be 1 to M outpUt nODes.
THe EdGes from Input nodes are CoMbined and tHeN spLit to tHE Output noDes.
Output nodes are never cONnected To iNput nOdes.
when an IodE "tiCks" it dOes THe balaNcing oPeratIoN on ITS assoCIAtEd nOdEs.
Maximum iNPUt pEr nodE pEr tiCk.
MaximUm output per node per TIck.
maximum total tHroUghpUT PeR
 itemSelector: Selector

   private  late ini t v ar  mod el:SharedViewMode l 

   override fun onCreat e(sav ed I nsta n ce State : Bundl e ?) { 
     s up e r. onCre ate (savedI nstanceSta te) 
       model =activity?. run  {
          ViewMo de lPr o vider s.o f(thi s).get ( Shared ViewModel :: c lass.j a va)
    }?:  throw Exception( " In v alid Activity" )

    i t emS ele ctor.setOn Cl ickLi s tener { it e m ->           mo del.select( i tem )  //<- - T h is wil l not if y  th e `DetailFr agme nt`
       }
  }
}
c lass De tailFr agm ent  : F r ag me nt( ){ 

 pri v ate  lateini tva r mod el:S h a r edVi ewM odel 

   override fun  on Crea t e(s avedI nstan ceSt at e: Bu ndle?)  {
      super.onCre ate( savedInst anc eS tat e) 
      mod el= a ctivity ?.run {       ViewModelProvide rs . o f( this).ge t(Shar e dV ie w Model::c la ss. java )        } ? :throw Ex ceptio n (" In valid A ct ivity" )
      mo d el.s electe d.observ e(thi s , Observer<Ite m > { item ->
     / / U pdate the U I
     })  }} 

Her e, th eS ha r edViewModel is acce ss ed inbothMasterFragmen t and theD e t ailFragm ent. Bo t h are accessin g the  same inst a nce of t he Sh aredView Model bec a u se bothofthe m a cce s s  t he ViewModelf r om t he  Activi ty' s Conte xt:  
V iew Mod el Providers .of(*ACT IV IT Y* ). get (Shar e dViewMod el ::c la ss. java) 
Now y ou ca n in cl ud e  so me Live D at a in t he  S hare dVi ew Model  and bot h fragm ents canlis t en /  u pd ate the m, which is e ve ntually re fl ect ed ont h e otherfragment as well.

 Q:How tobal anceinpu ts to out put s of t his direct ed gra ph?
Th e t y p e ofg r ap h I 'm  thinkinga b out  is v er y sp ecific.  I've come up with myown name forit:  Iod e (E YE- o de ) .
I t' s  ap l ay on "I/O" and  the elect ro n ic s terms "a n ode "and "ca thode". 
Iode An Iode  takes anumber of  i tems f rom  its assoc iated in put nodes and d i st ribut esthe it em s e venly  to it s  as socia ted ou tp ut nod es.
Th ere maybe 1 to N input nodes.Theremay b e 1  to M out put nod es.
The e dges  from inpu t n ode s are  co m bined  and th ens plitto t h e outputn od es. O ut put nodes a r e nev er co nne c ted to  inp ut nodes.
When an Iode "ticks" i t do e s  th e b a lanc in g operation on  it sa s sociated  n odes.
Maxim um input  p e r nod e pertick.Maximum o ut p ut per  nod e p er tick.Max im u m total  t hr o ughput  per 
 itemSelector:_Selector

 _  private lateinit_var model:_SharedViewModel

_ __override fun onCreate(savedInstanceState:_Bundle?) {
 _   _  super.onCreate(savedInstanceState)
__      model = activity?.run {
    __ ___  ViewModelProviders.of(this).get(SharedViewModel::class.java)
  _    _}?: throw_Exception("Invalid Activity")

      __itemSelector.setOnClickListener { item_->
        _   model.select(item)  //_<-- This will_notify_the_`DetailFragment`
   _    }
 _  }
}

class DetailFragment : Fragment()_{

    private lateinit var_model: SharedViewModel

    override_fun onCreate(savedInstanceState: Bundle?) {
 _ _    super.onCreate(savedInstanceState)
_  _ _  model_= activity?.run {
   _  _     ViewModelProviders.of(this).get(SharedViewModel::class.java)
__  ___ }?:_throw Exception("Invalid Activity")

__ __   model.selected.observe(this, Observer<Item> {_item_->
      _   __// Update the UI
_    _  })
   _}
}

Here, the_SharedViewModel is_accessed in both MasterFragment and the DetailFragment. Both are accessing the_same instance of the SharedViewModel because_both of them access_the ViewModel_from_the Activity's Context:_
ViewModelProviders.of(*ACTIVITY*).get(SharedViewModel::class.java)

Now_you can_include some LiveData in the SharedViewModel and_both fragments_can listen / update them, which_is eventually reflected on_the_other fragment as well.

 Q:

How to_balance inputs to outputs of this_directed graph?

The type of graph_I'm_thinking_about is very specific. I've_come up with my own name_for it: Iode_(EYE-ode).
It's a play on "I/O" and the_electronics_terms "anode" and "cathode".
Iode
An Iode takes_a_number of items from its associated_input_nodes_and distributes the items evenly_to its associated output nodes.

There may_be 1 to N input nodes.
There may be 1_to M output_nodes.
The edges from input nodes_are_combined_and then split to the output nodes.
Output nodes are never_connected to_input nodes.
When an_Iode "ticks" it does the balancing operation on its associated_nodes.
Maximum input per node per tick.
Maximum output_per node per tick.
Maximum total throughput per