<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMaxim%2Facm</id>
	<title>Module:Sandbox/Maxim/acm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMaxim%2Facm"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Maxim/acm&amp;action=history"/>
	<updated>2026-07-30T22:37:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Maxim/acm&amp;diff=145815&amp;oldid=prev</id>
		<title>imported&gt;Maxim: revert to old field name</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Maxim/acm&amp;diff=145815&amp;oldid=prev"/>
		<updated>2021-09-21T18:45:31Z</updated>

		<summary type="html">&lt;p&gt;revert to old field name&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {};&lt;br /&gt;
&lt;br /&gt;
local function majority ( frame )&lt;br /&gt;
&lt;br /&gt;
-- input args:&lt;br /&gt;
-- n-total-arbs, n-inactive-arbs, n-recused-arbs, n-abstained-arbs, n-is-motion&lt;br /&gt;
&lt;br /&gt;
   local acm&lt;br /&gt;
   &lt;br /&gt;
   if frame.args.motion==&amp;quot;yes&amp;quot; or frame.args.motion==&amp;quot;plural&amp;quot; then&lt;br /&gt;
      acm = math.floor((frame.args.active - (frame.args.inactive + frame.args.recused + frame.args.abstain)) / 2) + 1&lt;br /&gt;
   else&lt;br /&gt;
      acm = math.floor((frame.args.active - (frame.args.inactive + frame.args.recused)) / 2) + 1&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   return acm&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function active ( frame )&lt;br /&gt;
&lt;br /&gt;
   return frame.args.active - frame.args.inactive - frame.args.recused&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.readactive = function ( frame )&lt;br /&gt;
   -- cast stuff to numbers &lt;br /&gt;
   local nArbitrators = tonumber(frame.args.active)&lt;br /&gt;
   local nInactive = tonumber(frame.args.inactive)&lt;br /&gt;
   local nRecused = tonumber(frame.args.recused)&lt;br /&gt;
   local nAbstain = tonumber(frame.args.abstain)&lt;br /&gt;
&lt;br /&gt;
   -- determine if we have a case, motion, or motions&lt;br /&gt;
   local proceeding = &amp;quot;this case&amp;quot;&lt;br /&gt;
   if frame.args.motion==&amp;quot;yes&amp;quot; then&lt;br /&gt;
      proceeding = &amp;quot;this motion&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   if frame.args.motion==&amp;quot;plural&amp;quot; then&lt;br /&gt;
      proceeding = &amp;quot;these motions&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   local out_text = &amp;quot;For &amp;quot; .. proceeding .. &amp;quot;, there are &amp;quot; .. active(frame) .. &amp;quot; active arbitrators. &amp;quot;&lt;br /&gt;
&lt;br /&gt;
   -- report on inactive and recused arbs that are subtracted out of all majorities&lt;br /&gt;
   local subtract_text&lt;br /&gt;
&lt;br /&gt;
   if nInactive &amp;gt; 0 or nRecused &amp;gt; 0 then&lt;br /&gt;
        local arb = &amp;quot;arbitrator&amp;quot;&lt;br /&gt;
        subtract_text = &amp;quot;There is &amp;quot;&lt;br /&gt;
&lt;br /&gt;
        if (nInactive + nRecused) &amp;gt; 1 then&lt;br /&gt;
           arb = &amp;quot;arbitrators&amp;quot;&lt;br /&gt;
           subtract_text = &amp;quot;There are &amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        if nInactive &amp;lt; 1 then&lt;br /&gt;
           subtract_text = subtract_text .. &amp;quot; &amp;quot; .. frame.args.recused .. &amp;quot; recused &amp;quot; .. arb .. &amp;quot;. &amp;quot;&lt;br /&gt;
        elseif nRecused &amp;lt; 1 then&lt;br /&gt;
           subtract_text = subtract_text .. &amp;quot; &amp;quot; .. frame.args.inactive .. &amp;quot; inactive &amp;quot; .. arb .. &amp;quot;. &amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
           subtract_text = subtract_text .. &amp;quot; &amp;quot; .. frame.args.recused .. &amp;quot; recused and &amp;quot; .. frame.args.inactive .. &amp;quot; inactive &amp;quot; .. arb .. &amp;quot;. &amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
   &lt;br /&gt;
   &lt;br /&gt;
        out_text = out_text .. subtract_text&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
-- now give majority count (or abstains + majority count for motions)&lt;br /&gt;
   local maj_text&lt;br /&gt;
   if frame.args.motion==&amp;quot;yes&amp;quot; or frame.args.motion==&amp;quot;plural&amp;quot; then&lt;br /&gt;
       -- plural or not plural arbitrators&lt;br /&gt;
       local arb_text = &amp;quot;is 1 abstaining arbitrator, &amp;quot;&lt;br /&gt;
       if (nAbstain &amp;gt; 1) then&lt;br /&gt;
          arb_text = &amp;quot;are &amp;quot; .. frame.args.abstain .. &amp;quot; abstaining arbitrators, &amp;quot;&lt;br /&gt;
       end &lt;br /&gt;
       maj_text = &amp;quot;Since there &amp;quot; .. arb_text&lt;br /&gt;
   else&lt;br /&gt;
       maj_text = &amp;quot;Therefore, &amp;quot; &lt;br /&gt;
   end&lt;br /&gt;
   maj_text = maj_text .. majority(frame) .. &amp;quot; support or oppose votes are a majority.&amp;quot;&lt;br /&gt;
  &lt;br /&gt;
   out_text = out_text .. maj_text&lt;br /&gt;
&lt;br /&gt;
  return out_text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.abstentionrange = function ( frame )&lt;br /&gt;
   local out_text =  &amp;quot;0–1&amp;quot;&lt;br /&gt;
   if math.fmod(active(frame),2)==0 then&lt;br /&gt;
      out_text = &amp;quot;0&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   return out_text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.abstention_maj_r1 = function ( frame )&lt;br /&gt;
   return majority ( frame ) &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.abstention_maj_r2  = function ( frame )&lt;br /&gt;
   return majority ( frame ) - 1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.abstention_maj_r3 = function ( frame )&lt;br /&gt;
   return majority ( frame ) - 2&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Maxim</name></author>
	</entry>
</feed>