设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11700|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 O8 Y2 b; a, D1 m  [* k" z( e- m& u% f( W# N- k: O" Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ K& P- E9 u5 m
; S7 C2 z" V4 x% Dbegin P_read arriving
5 a0 s* M5 i& o- ^    while 1=1 do begin* E, A+ V! z! a" q$ o1 b) y. \) U% x
        read A_tote from "data.txt" with delimiter "\n"1 ^+ j7 p6 H$ l: a
        read A_time from "data.txt" with delimiter "\n"6 e8 u( X8 b) b% k$ }
        read A_leave from "data.txt" with delimiter "\n"
: b5 ]# m& p, P1 f        read A_picks from "data.txt" with delimiter "\n"% u3 |* k* Y7 n  M. x
        set load type to A_tote
' {$ H2 R+ h' T- i! N% ^        if A_tote="tote 1" then set A_induct to 15 f; _/ A1 j* j- T  [
        else if A_tote="tote 2" then set A_induct to 2- w1 R% P8 {0 c, U: F4 T- ~, p, h( l
            else set A_induct to 3    ! F" r' f) v7 O9 I- b9 {
        set A_i to 00 z* `' J' l/ Z& M$ D
        clone 1 load to P_induction
- b, m4 _( [6 \& @% Z! `; R  m* q        wait for A_time sec
) \1 w7 V! A: j    end2 Q% G2 O0 q0 O/ C  w
end
) P- E# ^0 G7 `% X% \- Z  q' w: h6 `5 U8 N
begin P_induction arriving, `& n# w8 a* n1 Q  W( C: [( \
    if A_induct=1 then clone 1 load to P_pick1
' d8 i9 v0 b. f( D2 c& t# p' |    else if A_induct=2 then clone 1 load to P_pick2
7 v8 L2 j+ \! O* A( y        else clone 1 load to P_pick36 `, K0 `" c3 P6 N
end
7 h7 k; P6 R' W
8 E* a1 T4 s- ?1 A5 ?8 M7 y0 n5 Vbegin P_pick1 arriving
: ~6 _. d' g' x1 y: N" t6 _    set A_i to 1) r" J' f& W9 {& D% O& z' ]. z
    move into Q_induct1* M9 I+ ~8 V; o* |9 ^  H4 l
    move into pickaisle.induct1
7 t+ n/ x: H; R) P/ e/ [    while A_i<=30 do begin9 ]0 N$ g- e5 y( f; {
        travel to pickaisle.con(A_i)  Q% V, {$ q- _* u! }7 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X8 O8 p* u$ n( l. K! c3 j+ k
        else wait for 10 sec$ w; o/ q2 D6 P9 ~2 l
        if A_i=A_leave then send to die
" E( c' D$ ~' z, q+ o. Q        else inc A_i by 1
0 n1 H+ q# M9 Y    end
0 D2 J; n! O* r/ u+ u. D: Aend  w- y" s- g- O! Y0 Y7 |
6 Q6 v, T$ w; `0 C0 U, i
begin P_pick2 arriving
: C4 X2 B% _& c* C' z) t! e    set A_i to 11- o1 v9 K0 Z6 h% |' f$ o
    move into Q_induct2
- s4 c* z/ n/ H7 r  E4 ?2 y& K    move into pickaisle.induct2" J, T2 B  t$ O: {* y; m
    while A_i<=30 do begin
% Y; ?8 c1 _) M        travel to pickaisle.con(A_i)0 a; z" K9 g% c$ O# `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  w' d) S3 b4 I
        else wait for 10 sec! o: e3 x, H. H+ s0 ^$ u
        if A_i=A_leave then send to die
2 ~. @! q" b1 o: |0 O+ H" }3 o        else inc A_i by 1
1 b. W0 p& l4 `$ B    end/ Y5 b' e) F* ]% u+ T; ~. [4 Y4 w
end! Y* `7 v8 U: I$ Y  o% w
+ p. X; G* N" C* T9 J& @
begin P_pick3 arriving
2 M5 y, B) U5 s1 p( q2 A    set A_i to 21
( V$ }# [* u6 t6 B    move into Q_induct3
) C/ [8 ?+ O( T2 U# K' |! B    move into pickaisle.induct3
& }1 G: P, Q/ c; b$ ^% w9 m    while A_i<=30 do begin
) [* B0 m$ k5 ?% n4 J. _        travel to pickaisle.con(A_i)
9 u3 n+ O7 x2 D# n4 X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y! d, ]! D7 e, o
        else wait for 10 sec. n: q( S7 x& Z2 ]
        if A_i=A_leave then send to die
, ?% G/ D( i* n! O4 a4 ?        else inc A_i by 1
/ F9 h, X; O: F: |: _    end
% w$ s) n; }2 ~; I& i5 y+ [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是个什么东东?7 w+ B* n' r) P" C. O5 _2 j, K+ ~* f
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( I% B8 T' u4 [" C# s% ]! s- ~
3 x$ e- W) A2 |AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  c9 H4 D8 I" {- y

% n' n* @% t9 F& n1 t7 j6 L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:  y, L9 s4 L# u% o9 C+ F
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; Z3 q7 q, ~* i  X9 t4 w0 w
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
" {& \7 c4 h0 m6 F% Y; u3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 A, Y; k9 I3 }: R  ibegin P_induction arriving6 b/ j% I0 y5 X
    clone 1 load to P_pick(A_induct)
1 Q' M5 l9 Z- x" g$ rend最大的系5 G; t2 g+ [: w6 k' Q) M

" G3 O& G- D8 r6 b4 d# ?begin P_pick arriving2 l- Z$ l  p5 [* R
    set A_i to procindex * 10 + 1- |+ H" J" _( X* d9 @3 Z6 `# a1 V
    move into Q_induct(procindex)
2 f4 Y+ @# D3 O9 k3 `" e    move into pickaisle.induct(procindex)
  b5 g% k7 |3 _2 k    /*check the type of pickaisle.induct(i), for your last problem.*/
1 ^7 l; {( e% T4 t& s
" F' \  g- o, `+ F  p8 }7 T4 [$ O    while A_i<=30 do begin
4 O8 b0 F+ u/ Z, k        travel to pickaisle.con(A_i)- b8 o+ a( a" p/ G5 a; \/ z7 F  D2 V
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# x8 t2 h& E9 e% e1 q  h
        else wait for 10 sec7 S) I' n5 H0 I; B2 A
        if A_i=A_leave then send to die
6 T4 K7 O/ T8 O4 H: k7 Y        else inc A_i by 1
) h" w3 f1 v7 J# y- \9 I    end9 I' }, U: I& [! F) D1 V6 \
end  H2 n9 j1 u) p4 s' D

& h3 S6 j# ~5 @  r' C其中的procindex为整形,代表当前process的序号。
0 A" x; G* X5 I0 Bstation和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, 2025-11-28 04:42 , Processed in 0.019844 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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