[r-t] Writing method display software
Alan Burlison
alan.burlison at gmail.com
Fri Oct 30 19:50:40 UTC 2015
Hi, I'm hoping this is the right place to ask, or at least as right a
place as there is...
I'm a new ringer, actually ringing methods is way beyond me at the
moment but I'm interested in the theoretical background. I generally
find it easier to investigate things when I have something to play with
so I've been fiddling around writing some software to expand and
manipulate changes. I'm not intending to use this for anything other
than learning purposes, I'm aware there are existing libraries such as
the C++ Ringing Class Library as well as various composition and peal
proving tools, but where's the fun in that :-)
One of the problems I'm having is terminological overload - much of the
material that's out there assumes you already understand the somewhat
specialist language (!) So far the best thing I've found is Section I of
the CCBR "Descriptive Framework and Requirements for Method Ringing"
document - unsurprisingly so, bearing in mind the purpose of the
document ;-) However I'm wondering if there are any other resources that
are good places to start.
I have something simple working already, the next thing I'm intending to
do is to hook it up to the method database at
http://methods.ringing.org, but have a couple of questions. The first
is, what is the minimum data I need to extract from the method DB in
order to expand it out? I'm assuming it's just the <stage> and <pn>
elements, stuff like the <lead-head> or <classes> aren't needed? The
second question is that there are multiple place notation variants using
all sorts of '&' 'le' etc tags, are those used by the DB? And is there a
reference parser implementation for the place notation used by the DB?
To give a flavour of what I've got so far, I'm using a Functional
programming language (Scala) as it's a close fit to the problem domain.
Here's the code to print out Plain Hunt:
val ring = Ring(8)
val plainHunt = ring.Block(
ring.Change(2,1,4,3,6,5,8,7),
ring.Change(1,3,2,5,4,7,6,8)
)
val change = plainHunt.forever
var row = ring.rounds
println(row)
do {
row = row * change.next
println(row)
} while (row != ring.rounds)
}
All the input is validated, e.g. each Change has to have 8 bells, there
have to be no duplicate bells. The framework code to do that and
calculate the changes is less than 100 lines of code. For example, the
implementation of row multiplication is trivial:
def *(change: Change) =
new Row(change.positions.map(p => places(p - 1)))
and row division is only slightly more complicated:
def /(change: Change) =
new Row(change.positions.zipWithIndex.sortBy(_._1)
.map(t => places(t._2)))
--
Alan Burlison
--
More information about the ringing-theory
mailing list