设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15251|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 [2 Y! Y* y* `. t; w! q4 t& ]5 x

2 y. Z1 x  J! c, Z  `我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ U' H8 H) }8 {% B0 y& X' z6 t2 J3 }2 i6 K* h  E3 Y
begin P_read arriving7 t0 u1 T" Y+ u0 ~* ^6 y- P% G
    while 1=1 do begin
8 C/ R& G! }8 s5 I6 g        read A_tote from "data.txt" with delimiter "\n"
7 }% b/ N" @, W; k        read A_time from "data.txt" with delimiter "\n"
2 U0 z& _9 ]8 v2 F+ N' I        read A_leave from "data.txt" with delimiter "\n"6 d& \* e$ @- @* V
        read A_picks from "data.txt" with delimiter "\n"
3 D4 u! I2 O# t9 q/ D3 f3 i+ Q- s        set load type to A_tote
, s5 z" u9 E. Y  P% f        if A_tote="tote 1" then set A_induct to 1
" L' d# |- c% `4 Q        else if A_tote="tote 2" then set A_induct to 2
4 b6 o! Q2 V" A4 d6 `) [            else set A_induct to 3    ( V2 s" ~* F0 y  p  e  h
        set A_i to 0& |- s0 C+ f7 `' d- [: n9 z- {
        clone 1 load to P_induction
) w# d! {# L" I2 T. F; u/ M0 w1 |2 W+ K        wait for A_time sec- a2 v, R' J( ]$ q
    end
& c( b  h  ]$ c, k) R* _end8 ~, A4 s9 m; J) K/ ^6 t

2 h/ M- h+ }. b/ j8 Lbegin P_induction arriving! @# J6 _0 v" U% y. Y% \" _
    if A_induct=1 then clone 1 load to P_pick1
4 `) N7 `7 X  A1 [& D! |    else if A_induct=2 then clone 1 load to P_pick2
. }: y7 A) p/ W& T        else clone 1 load to P_pick3
! Q- x" Z7 b' V" L; M2 m# Send
& k+ v5 @' u: O1 L! h* {( G- p
( o( Q$ k4 f* Cbegin P_pick1 arriving
$ @8 j4 o* \" I8 X. {% i    set A_i to 1
: X8 w  s$ y, V1 I' Y; Y9 f    move into Q_induct1  @2 U$ t# L. h# ]
    move into pickaisle.induct1
0 k- V* ]" m1 d, r) N# B$ z8 b! e# \    while A_i<=30 do begin; G; B8 l* }2 |2 K4 b9 ?
        travel to pickaisle.con(A_i)
& h" L  s# P0 }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 s- B) f5 e% x- n1 Z/ X4 F
        else wait for 10 sec; t, L4 I2 Z5 a6 q% a
        if A_i=A_leave then send to die
$ O* _) V- G! y- W' t        else inc A_i by 1- ?# [9 {5 C5 k! U
    end, T  a5 k9 i# @, M+ |; v7 `! _& O# b
end4 H9 \8 e7 f" L1 X

; u  ]  S! a! w/ Gbegin P_pick2 arriving
! s0 w! O$ m4 W) e& d+ K9 F% O    set A_i to 11
1 [% o7 V( L; i# f  N    move into Q_induct2
% R0 V7 x1 E) v- U  [3 v    move into pickaisle.induct2
7 H$ u, @+ M+ K    while A_i<=30 do begin
! D( i) N  \, G4 k        travel to pickaisle.con(A_i)
% E; d* c/ ~2 ^/ y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. j0 X: X6 Q$ C# _6 ~0 B        else wait for 10 sec5 P- t" V+ C1 d3 Z1 \) w9 L1 V
        if A_i=A_leave then send to die; o1 U: r  b! p8 v
        else inc A_i by 1
' H) g  j, k- l: E8 V. Q5 `4 P    end- d% H: L- ]4 J/ u9 `
end4 p9 W# M- E2 o1 n/ r

8 \- }4 R3 L, p. p% G1 `begin P_pick3 arriving/ b; A& G# V% A0 E9 R. l, G
    set A_i to 21
9 r& b6 n1 S. W5 }/ Z* n4 `    move into Q_induct3
- u$ P% i; o  b; P8 O    move into pickaisle.induct3  w8 h+ v/ O0 K3 a) M; p5 ^
    while A_i<=30 do begin3 n6 c% [. b" b3 ?0 A  F8 h
        travel to pickaisle.con(A_i)
& m- }5 S3 j# @$ ]        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  ~. D" x* p+ a2 _9 c! Y* y
        else wait for 10 sec
/ j! a! o) G! r' L! v3 w, E  w        if A_i=A_leave then send to die1 D6 g8 w0 y: Z- x  u# e
        else inc A_i by 16 c% X3 R: [" D3 Z
    end0 |4 I6 p7 R& ?0 q% }4 U
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是个什么东东?
' J. Z" z( m7 @2 f5 Nmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?7 `) T1 i" ~+ R/ I6 \

# t+ p, e7 \3 Y' |- o' d8 ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
7 f: x9 V, w* N; R5 v1 Z( \
6 k) f- c# u8 g0 J% n3 {& @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; T, n/ p) O6 e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% d& ^& N1 M! e! r4 R: s( F
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
6 e2 l  c, x0 a9 r1 }3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) @7 {8 L- Q" i& B) a: [- V* b9 u
begin P_induction arriving! F1 t3 l; q7 R! o
    clone 1 load to P_pick(A_induct)
7 E& @1 D- a3 U' _4 A, G5 p6 r8 aend最大的系0 B) P( ?' b: o1 A
2 u8 \6 L  Q2 W$ e7 ^- @, g
begin P_pick arriving
0 u' `0 w# m( ^    set A_i to procindex * 10 + 1) A7 I7 s) D! ^
    move into Q_induct(procindex)0 T0 Q# e( u3 v; x5 O' \' b6 B! g8 M2 M
    move into pickaisle.induct(procindex); O$ K  O/ a6 d. q" J
    /*check the type of pickaisle.induct(i), for your last problem.*/( J, G* e; _) R

& s. ]+ @$ C) }    while A_i<=30 do begin
9 a9 h# W$ L) {0 o& `& {# B0 h- \        travel to pickaisle.con(A_i)
0 ?- I/ ]$ d- c6 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
  n7 U4 ^& [8 i6 d5 L        else wait for 10 sec
  L) \* o8 ?, s        if A_i=A_leave then send to die, t. m. ~8 A: f* N- |9 {. U
        else inc A_i by 1+ J5 [4 M8 H. ^7 c
    end. n* p8 ], X0 x6 E
end
' W' O+ n) {3 U. d5 G. `, W; L# u# v8 H+ K. p' o& K6 `1 T5 H
其中的procindex为整形,代表当前process的序号。8 e! h! k% h- y- Q4 h3 `
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-8-27 16:21 , Processed in 0.017807 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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