设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12386|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% f) S$ G5 G. w
  E1 L) X4 o1 J, ~. F0 ?
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。5 U6 s" p" I' G/ Q' c2 j

* T  N) H$ X# @1 R# e& U' Obegin P_read arriving5 E5 M7 h* S4 o+ T9 x% i
    while 1=1 do begin
( @# f$ M2 C4 t1 W4 B$ b4 s        read A_tote from "data.txt" with delimiter "\n"
9 O: u- B- [* k7 a, i2 @        read A_time from "data.txt" with delimiter "\n"+ _  Y6 z% A& z
        read A_leave from "data.txt" with delimiter "\n"# J8 {4 O, A9 A: e4 `* J8 a; {, m
        read A_picks from "data.txt" with delimiter "\n"
% e2 E# L% |8 K- y  N3 O8 M1 D        set load type to A_tote7 S7 ^- s0 R8 l/ f' g
        if A_tote="tote 1" then set A_induct to 1
- _6 u- g% X$ J+ X9 g9 F; {$ s) E        else if A_tote="tote 2" then set A_induct to 2$ `' v3 f5 }5 K, q
            else set A_induct to 3   
% i  n$ S. m: I* j        set A_i to 0: v1 H9 J! W$ [5 \) F$ P& ~( ?5 o
        clone 1 load to P_induction+ S6 [. G! u/ z( e$ Q6 A! s
        wait for A_time sec
( [' Z; A: W4 c$ K* u3 G    end
# z' j' ^8 k  q( E$ Y: @, Zend1 |, h% W# c! I' |
  X/ I5 k  C1 S0 u# P, h
begin P_induction arriving
( B: R: u# Z  f7 Q: z4 K    if A_induct=1 then clone 1 load to P_pick1* F2 x9 r7 J5 x+ H# Z3 z
    else if A_induct=2 then clone 1 load to P_pick2- Z' U& W0 }; Y- Y* c4 P- e% F
        else clone 1 load to P_pick3
0 t: Z) z) O2 g' N3 r. p  Yend
! ^$ k: p# k! {6 ~
7 d8 c* b. V/ w- ~begin P_pick1 arriving
2 ]$ u3 M4 g+ e8 ~# r    set A_i to 18 `& J- W, j" y3 Z+ O
    move into Q_induct1
9 c3 Z+ l; c! X4 X' f    move into pickaisle.induct1
1 S3 m. a$ z9 K. ?. u6 m    while A_i<=30 do begin9 Y/ e2 U( N7 p
        travel to pickaisle.con(A_i)
$ A$ m. _! q6 r& e8 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ a) {+ O0 P4 E# A$ _
        else wait for 10 sec0 ?$ y" A. J" Z
        if A_i=A_leave then send to die
& W- b. j) t  n7 B        else inc A_i by 1
) o# {1 {8 a1 x    end
2 ~  I3 \  F/ n1 x  m! Iend' j4 i% N) R! e8 t& R5 e6 @* {3 ?4 D% O
8 n6 ]1 k5 D& c' v
begin P_pick2 arriving1 k1 @" C6 K/ O# o
    set A_i to 11
: T( v+ }9 [" B: Z1 w    move into Q_induct2
0 k5 T/ t+ D- ~" E, v, t    move into pickaisle.induct2; S: [' j' w* G* W* A3 P0 a
    while A_i<=30 do begin
3 J5 [) n0 A" c7 r        travel to pickaisle.con(A_i)$ u8 W# F7 i7 R
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; o- i* I  j$ }& ?
        else wait for 10 sec7 X- ]0 @0 a' i! Q8 y
        if A_i=A_leave then send to die& W# D9 \% L' Y
        else inc A_i by 1
; q, x6 f2 V; w# k0 t9 R: Q4 s8 S    end$ w$ e! a6 ]! D5 A
end$ P5 E  W9 M1 G0 N$ P5 F$ }. P5 h
  G4 `) g- R' p6 z3 T3 ]
begin P_pick3 arriving
1 H4 v! u0 B7 i' q    set A_i to 21+ o' V3 k3 _5 _; H
    move into Q_induct3
7 y- K" d) M* `7 s    move into pickaisle.induct32 G) F. d) z$ a' a5 P) S
    while A_i<=30 do begin; \6 o. I; ]4 E( w9 I/ O8 G
        travel to pickaisle.con(A_i)- b# n" c. ]: l9 Z+ u
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 Y5 j1 o' U0 |$ i# A- @  m        else wait for 10 sec
& Z; C# J( B: A        if A_i=A_leave then send to die6 {! e" [3 i$ v+ ]/ U( Z3 q
        else inc A_i by 1! N% g5 u! A/ A- \" [
    end' Z3 B4 b% l* l/ L( h
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?5 R4 N: f- B/ F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?9 g0 P' _, n0 q

8 B1 ?. R) R2 PAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% O5 n8 p: E8 F
0 f2 v  P7 S, z5 G& c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) N* c* |1 K8 ], \: l6 \
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
& G8 a0 F' F6 f/ T- `1 W. r3 F2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;* a7 _4 t# w. S2 E  r0 y  r2 @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) g  j9 p1 t3 t6 S. ]begin P_induction arriving& w% h% H- x! _
    clone 1 load to P_pick(A_induct)2 ~$ J( w! x! O
end最大的系0 v, m; G/ x' j
% y6 y8 @; f' u" \1 m
begin P_pick arriving/ n3 o* i! u- z) Q) D/ P2 I6 }
    set A_i to procindex * 10 + 1
6 p/ H+ k; v2 f: X6 x) D2 S7 m    move into Q_induct(procindex)9 H& v# b+ g' @
    move into pickaisle.induct(procindex)
1 n2 L2 i* ^6 [) Z% i: W+ h    /*check the type of pickaisle.induct(i), for your last problem.*/8 `2 q# r9 A+ {4 q
" v. T3 e% {0 j
    while A_i<=30 do begin
% l) Q2 i% g' U# S5 E        travel to pickaisle.con(A_i)
# E9 O* N/ r/ G+ v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' F  U3 c, S; b        else wait for 10 sec
7 U+ k: M7 X) X7 w+ f        if A_i=A_leave then send to die
# x. b6 H) p* C- i        else inc A_i by 1
& j# n9 k8 p, p1 M    end
( U- Y' k- j1 cend
( e9 y7 v( j+ ^- m  ]+ x% p7 I7 y' n, b8 P( n4 H" r
其中的procindex为整形,代表当前process的序号。( h' ?2 ~/ E, Q+ {
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-1-20 12:34 , Processed in 0.018876 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表