设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14077|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& T+ D5 f9 Q, y) t9 p5 T% N. H

# z! @3 j3 w2 a6 h5 {, v我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 v6 A, \$ K- u0 H
) R5 F7 @/ P# x9 E" D
begin P_read arriving
, V) a; \5 e5 V; f$ I% X    while 1=1 do begin1 o5 H7 _. i. x2 s  E
        read A_tote from "data.txt" with delimiter "\n"
. d  P$ `; u  j6 X, e' J        read A_time from "data.txt" with delimiter "\n"
  Z" X7 T( V# R        read A_leave from "data.txt" with delimiter "\n"" U# p; ^( @' C. O
        read A_picks from "data.txt" with delimiter "\n"
0 }1 S- k! t$ w) Y; Z! ?. `        set load type to A_tote9 `0 F5 i/ J' ]1 f5 G2 u& a, ~
        if A_tote="tote 1" then set A_induct to 18 r, o+ ?1 t" P
        else if A_tote="tote 2" then set A_induct to 29 Z, ^: H5 g5 a+ J: Y# x- y" f+ ?
            else set A_induct to 3    9 m5 L- Z7 X1 c2 e8 {( d
        set A_i to 0
8 y9 c/ j/ B" {1 M$ ]* q4 c; }" _        clone 1 load to P_induction
3 q# L8 x; X0 Q* I: o2 h% }        wait for A_time sec1 f! ]7 i' E/ T8 |/ S
    end
4 v7 ]- t- |$ i) B* p& i8 L7 [end2 Y8 i2 y  h- |+ J; i5 E

. L  i! Z" Y! L% f% D8 q5 Jbegin P_induction arriving
& Y* T" e0 Z2 S0 k7 }' S" p% l( m    if A_induct=1 then clone 1 load to P_pick1" F$ O1 I' l! o) J7 G
    else if A_induct=2 then clone 1 load to P_pick2
( g) I2 H5 b" ~: |        else clone 1 load to P_pick3: t8 b. ^# v; Y, K8 D
end& Y0 k: S8 z4 f% ~( U

  l/ D3 V% V3 \3 Q- g3 f. Ebegin P_pick1 arriving" ]9 q) \8 d6 p; e$ U( w4 t
    set A_i to 1
4 X( j5 X4 ]& Q, B$ A    move into Q_induct1
& D# {- b0 c6 u" u    move into pickaisle.induct1
' ~7 e( B/ z' |; ^    while A_i<=30 do begin
( Q( m4 c& `4 ~, V% s        travel to pickaisle.con(A_i)* H' w0 d% k  j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 r, W7 R* x' Y6 d) O2 `        else wait for 10 sec9 p7 z3 U) Z, z
        if A_i=A_leave then send to die* |: \0 s* u) z6 l, ]: w5 o% B
        else inc A_i by 1
/ ]: i$ |0 F4 f% ~& S6 c    end6 C8 n. \# C: N' q7 w) L
end
* L$ M( n4 J& \+ n% ^
' ]3 b! A, v9 [/ |/ V' X' sbegin P_pick2 arriving
/ b+ v5 L6 S( Z! K3 P  f    set A_i to 11
: |. E% `* z" a, |% K# t. \    move into Q_induct2
: f( k2 i' U! a) I- a    move into pickaisle.induct2
& n; u! G5 v5 E9 w& i; w    while A_i<=30 do begin9 j. }/ _" T' }: T- |, V& r, h
        travel to pickaisle.con(A_i)* R1 w( |3 o9 N7 {. L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( l9 p& U9 u' a, D% d  [( U% c! Q
        else wait for 10 sec. J3 J! m2 a) U* f9 k
        if A_i=A_leave then send to die. ?* q9 I- {/ [- ?! [) u: Y
        else inc A_i by 1
3 s- S$ N+ s) h/ ^    end
5 r3 h% d" l% g* j" I- G. R7 l+ Rend0 K- g- F4 m; O1 q& @9 \

* X3 [* ]& s  T/ A/ ~3 J9 s+ ]begin P_pick3 arriving. e' O  M/ O) i/ n1 p( n  w
    set A_i to 21
. A' \$ ~) I7 `8 L  k    move into Q_induct3
$ ~+ D9 O% o1 M1 {" s6 b    move into pickaisle.induct3- o: u  o* o) a
    while A_i<=30 do begin& i% p, e7 [& Q
        travel to pickaisle.con(A_i)8 `" I& J5 u9 H! A/ S9 [1 Y% X+ S! `
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 i( W( N0 l% g$ |3 z) L! Q. o. X        else wait for 10 sec! B9 V# F  B- n* N8 i2 X9 l' F
        if A_i=A_leave then send to die
% A0 s' y# Q: T: u4 P        else inc A_i by 12 c; X6 m& ?  |0 m8 i' b6 K
    end
/ V- K) e% Q# ?: b% cend

最佳答案

查看完整内容

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是个什么东东?) ?* L  T2 d( f8 |
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?) q- e' ~+ X  w! r. \

% u; c2 ]$ `8 ZAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。; I* a" g# B3 F" k: T0 B; j9 j* @
9 d6 g" `, a* }* _: s3 j
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
3 ~! n& S! X7 f1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- a4 S' N: {4 w2 m4 |
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 ?9 k' K+ x; \' A
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 E; ~' f5 N3 |2 I& X; ^
begin P_induction arriving% @) ]' C. E( J" q: v
    clone 1 load to P_pick(A_induct)$ q7 h. F, q' W& L5 e+ S
end最大的系  y) Q% z- X2 `) |" l0 T% n
* f" a8 K8 Q+ C! w9 g5 m
begin P_pick arriving  f+ }1 Y. J9 y/ }
    set A_i to procindex * 10 + 13 f$ T$ p# E3 I8 G: M; r6 s% J
    move into Q_induct(procindex)
3 e# Z9 t0 \; R1 Z    move into pickaisle.induct(procindex)
! [* t' i6 i  a7 e% U, e    /*check the type of pickaisle.induct(i), for your last problem.*/+ f2 r$ C! q5 E  N- l5 S' e

4 u  n/ e# \% r    while A_i<=30 do begin
2 g" h4 t; w! E. f1 C; d1 [/ R        travel to pickaisle.con(A_i)3 L6 h- p! o& g' h8 }' e" ?
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 i0 L* X: K' ?1 g8 b        else wait for 10 sec
0 p; J1 ~! i2 e4 k' \        if A_i=A_leave then send to die
6 y# E9 P' I) G; y- \        else inc A_i by 1. {, i6 K, R0 i/ f1 Q6 Y5 b6 w
    end
$ i! e; U# w' w$ S4 jend
  }* t- r( y: x8 k# S. B+ f8 a# b9 o$ M
其中的procindex为整形,代表当前process的序号。/ T  i, d9 B" \) t7 _1 `- 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-6-6 04:45 , Processed in 0.015507 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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