设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13759|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 d* a# a% T$ ?3 j+ D! O+ n4 J: L$ }9 w6 w4 ?2 N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( |+ C3 q1 Q! q1 m7 J( u
$ [- [  Z8 [7 a. z$ H; r
begin P_read arriving! K; n. y- |( N2 l  f# T  v0 C$ f
    while 1=1 do begin* I9 ]# U$ P& i/ f- r, J, T: p; K
        read A_tote from "data.txt" with delimiter "\n"! H: f. N/ N: y* |) S
        read A_time from "data.txt" with delimiter "\n"5 H7 q- b  E+ l. e% D/ u) Z3 d
        read A_leave from "data.txt" with delimiter "\n"
: a6 [& p2 U' A; z) D: c" v        read A_picks from "data.txt" with delimiter "\n"- f$ m& f$ w7 \' ^+ z, p) N
        set load type to A_tote
) I! c& [" J! u        if A_tote="tote 1" then set A_induct to 1
# J# O4 K, s( e% _) i/ _        else if A_tote="tote 2" then set A_induct to 2
  s. _+ }. F9 e9 f* f2 I# y            else set A_induct to 3   
; S: ]2 j7 B! |        set A_i to 0
& X; o' H" A, H8 N9 T        clone 1 load to P_induction4 l, w+ }8 P. W4 ^2 U0 V9 Y
        wait for A_time sec& R9 Q$ @! G9 [' a% }
    end
$ m1 C) h3 d7 b/ P5 {7 rend
3 H1 t' Z- d# ^4 {- \. [+ Z5 Q6 U
. c# F* M7 ~4 X9 F5 r3 X; t$ Tbegin P_induction arriving- t8 a. x3 ^$ s4 U& r& a
    if A_induct=1 then clone 1 load to P_pick17 o& r! j0 i6 ~$ ^
    else if A_induct=2 then clone 1 load to P_pick25 ~. l. n+ V- \, u( ?! z
        else clone 1 load to P_pick36 ]0 C' q9 F- A
end5 P$ R' Y2 X' h  M, D

3 D9 A  K' d! C6 Z' E- wbegin P_pick1 arriving7 V8 i7 x! j. |7 \7 c
    set A_i to 1: s; R2 z- p* l4 E9 t! M
    move into Q_induct1- D3 {$ S2 H* H5 b
    move into pickaisle.induct1) P1 T$ h* k4 z5 [* P# F+ [6 j) x
    while A_i<=30 do begin
7 Y+ L  v& ~$ F% A& r/ @# y        travel to pickaisle.con(A_i), T- }. t$ Y9 J- |& U! {! N$ |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 l2 ?6 {+ j9 j! @" z" x. P
        else wait for 10 sec% O; x5 c6 F( _# v/ y$ h3 @
        if A_i=A_leave then send to die5 d" g# l# j2 |( h
        else inc A_i by 1
- h9 t* Z* h( C    end
% m- T* C6 K6 H8 u7 w6 rend/ c5 E  e. x" X/ p3 ]3 P8 \. Z+ K. h, X
* U  J$ T; W5 s6 T
begin P_pick2 arriving
3 E1 P" M" S1 U' G    set A_i to 118 I6 _1 |. I" V/ y
    move into Q_induct2. ]! q( S3 l6 `& c1 M
    move into pickaisle.induct2
. v4 m- G9 h2 Q1 d  b! s& `    while A_i<=30 do begin# F, F- C  c' l* P$ ^
        travel to pickaisle.con(A_i)! Q" X. x# [8 C# i2 P
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" }( U) g6 M0 E0 K: v$ U6 ^        else wait for 10 sec
% w* V  ?' }, ^; T7 R8 U# Q        if A_i=A_leave then send to die" }6 h: ~! w' l$ M7 L! X
        else inc A_i by 1% H6 C8 C/ U+ ^0 M9 \. ?+ R
    end
8 P. i1 Z$ M5 D; @, x* J* \7 ^end- J! T: b8 j# ^( i( t) v
. q* m2 `: X  g2 Q% q$ W
begin P_pick3 arriving
1 V' y$ @! {6 C9 L* C4 c5 V7 p6 M    set A_i to 214 p2 t: n/ }+ Y, w: r: W" J/ s* `
    move into Q_induct3
1 c# Y) ~; ?8 R1 [    move into pickaisle.induct3
# J+ ?7 }* m6 R" D6 U    while A_i<=30 do begin6 Z) z3 X- p. x0 t8 f) d9 B
        travel to pickaisle.con(A_i)& `# ^* H7 g- p& S+ ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 X/ }. V0 _6 O4 \        else wait for 10 sec
1 b, ~: _# O0 W! V5 ?; P7 E        if A_i=A_leave then send to die
/ t9 Q* t( u6 A        else inc A_i by 1
! M2 W: ?& d) I- \$ u3 V    end% j0 Z' b& N1 h+ l: V6 x4 ?( i
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是个什么东东?" k- D: y* `: ]# ?$ p& M
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?( q! }5 W9 d/ ^7 n  b* ]
7 a1 C. |6 m8 f8 `
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。0 c( G0 S) d6 t$ f

! r! M* u/ A! l9 I$ }& c. F另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
( S; {5 M1 p0 g1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" \& g; E9 a2 f
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' d) _, G2 C3 K6 g0 l
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:: D$ B5 X( Q3 f8 W1 ^
begin P_induction arriving
( Z0 Q# z# g* n% l4 _% n: {    clone 1 load to P_pick(A_induct). j1 |7 H% O! X, E( C$ N' Z9 y
end最大的系
9 B4 P% a  \, [$ \' V. O: t0 V9 r1 `4 t9 Q; P& n
begin P_pick arriving9 Q9 B7 A2 n& P* r9 ?" [, n6 N
    set A_i to procindex * 10 + 1: ^4 u0 F+ h. U
    move into Q_induct(procindex)0 ]! Z4 A: u4 B9 ^! s
    move into pickaisle.induct(procindex)
& v8 e! C( m* ]7 M2 z    /*check the type of pickaisle.induct(i), for your last problem.*/' X0 |1 y" c& d% f' Y, {1 z4 C
. @' R; I* T' X# J
    while A_i<=30 do begin
$ f" O" D/ c- d2 W) |        travel to pickaisle.con(A_i)  u  @) }7 P+ i% p8 T0 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% n+ g. [& b  K. j( g+ |7 O
        else wait for 10 sec
0 P' M5 [$ S1 x6 r; S* ]        if A_i=A_leave then send to die9 Z; t8 E" E6 g$ {6 d, x
        else inc A_i by 1; i( Z3 b) A  j4 S- G
    end
4 s3 L6 n8 h2 w( B$ w) |  aend
' g, b" p) ~8 ]# \/ _  C2 ~6 A, z" u4 U) d$ t7 W5 [5 n# E
其中的procindex为整形,代表当前process的序号。
7 X* m, T. J, n1 Z. X' u* D3 Z! Qstation和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-5-3 09:38 , Processed in 0.018398 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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